diff --git a/extensions/tokenizers/src/main/python/djl_converter/huggingface_converter.py b/extensions/tokenizers/src/main/python/djl_converter/huggingface_converter.py index da82ff0ff98..8f0eff8ce61 100644 --- a/extensions/tokenizers/src/main/python/djl_converter/huggingface_converter.py +++ b/extensions/tokenizers/src/main/python/djl_converter/huggingface_converter.py @@ -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