Unverified Commit 64bdbd88 authored by Yih-Dar's avatar Yih-Dar Committed by GitHub
Browse files

Don't set `finetuned_from` if it is a local path (#28482)



* fix

* fix

---------
Co-authored-by: default avatarydshieh <ydshieh@users.noreply.github.com>
parent 881e966a
...@@ -559,7 +559,11 @@ def main(): ...@@ -559,7 +559,11 @@ def main():
trainer.save_metrics("eval", metrics) trainer.save_metrics("eval", metrics)
# 11. Write Training Stats and push to hub. # 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: if data_args.dataset_name is not None:
kwargs["dataset_tags"] = data_args.dataset_name kwargs["dataset_tags"] = data_args.dataset_name
if data_args.dataset_config_name is not None: if data_args.dataset_config_name is not None:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment