Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tokenizers] Replace pt file names to safetensors #3417

Merged
merged 1 commit into from
Aug 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,11 @@ def save_rust_model(self, model_info, args: Namespace, temp_dir: str,
shutil.copyfile(file, os.path.join(temp_dir, f))
elif pt_files:
for f in pt_files:
# Change file name from pytorch_model*.bin to model*.safetensors
target = f.replace("pytorch_model", "model").replace(
".bin", ".safetensors")
file = hf_hub_download(repo_id=model_id, filename=f)
convert_file(file, os.path.join(temp_dir, f))
convert_file(file, os.path.join(temp_dir, target))
else:
return False, f"No model file found for: {model_id}", -1

Expand Down
Loading