Skip to content

Commit

Permalink
Don't set finetuned_from if it is a local path (huggingface#28482)
Browse files Browse the repository at this point in the history
* fix

* fix

---------

Co-authored-by: ydshieh <[email protected]>
  • Loading branch information
2 people authored and MadElf1337 committed Jan 15, 2024
1 parent 11f273a commit 1c87065
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion examples/pytorch/contrastive-image-text/run_clip.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,11 @@ def filter_corrupt_images(examples):
trainer.save_metrics("eval", metrics)

# 11. Write Training Stats and push to hub.
kwargs = {"finetuned_from": model_args.model_name_or_path, "tasks": "contrastive-image-text-modeling"}
finetuned_from = model_args.model_name_or_path
# If from a local directory, don't set `finetuned_from` as this is required to be a valid repo. id on the Hub.
if os.path.isdir(finetuned_from):
finetuned_from = None
kwargs = {"finetuned_from": finetuned_from, "tasks": "contrastive-image-text-modeling"}
if data_args.dataset_name is not None:
kwargs["dataset_tags"] = data_args.dataset_name
if data_args.dataset_config_name is not None:
Expand Down

0 comments on commit 1c87065

Please sign in to comment.