Unverified Commit 94e17c45 authored by Sanchit Gandhi's avatar Sanchit Gandhi Committed by GitHub
Browse files

[Trainer] Fix model name in push_to_hub (#20064)

parent 19067711
...@@ -3444,7 +3444,8 @@ class Trainer: ...@@ -3444,7 +3444,8 @@ class Trainer:
if not hasattr(self, "repo"): if not hasattr(self, "repo"):
self.init_git_repo() self.init_git_repo()
if self.args.should_save: model_name = kwargs.pop("model_name", None)
if model_name is None and self.args.should_save:
if self.args.hub_model_id is None: if self.args.hub_model_id is None:
model_name = Path(self.args.output_dir).name model_name = Path(self.args.output_dir).name
else: else:
......
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