fix: only export tokenizer when exporting full model

Fixes #143
This commit is contained in:
Philipp Emanuel Weidmann
2026-02-14 09:18:22 +05:30
parent 6017bcd347
commit e7f8be98b7
+6 -8
View File
@@ -755,8 +755,7 @@ def run():
merged_model.save_pretrained(save_directory) merged_model.save_pretrained(save_directory)
del merged_model del merged_model
empty_cache() empty_cache()
model.tokenizer.save_pretrained(save_directory)
model.tokenizer.save_pretrained(save_directory)
print(f"Model saved to [bold]{save_directory}[/].") print(f"Model saved to [bold]{save_directory}[/].")
@@ -813,12 +812,11 @@ def run():
) )
del merged_model del merged_model
empty_cache() empty_cache()
model.tokenizer.push_to_hub(
model.tokenizer.push_to_hub( repo_id,
repo_id, private=private,
private=private, token=token,
token=token, )
)
# If the model path doesn't exist locally, it can be assumed # If the model path doesn't exist locally, it can be assumed
# to be a model hosted on the Hugging Face Hub, in which case # to be a model hosted on the Hugging Face Hub, in which case