mirror of
https://github.com/saymrwulf/transformers.git
synced 2026-05-14 20:58:08 +00:00
Fix psuh_to_hub in Trainer when nothing needs pushing (#23751)
This commit is contained in:
parent
06c28cd0fc
commit
7d4fe85ef3
1 changed files with 4 additions and 3 deletions
|
|
@ -3699,9 +3699,10 @@ class Trainer:
|
|||
commit_message = f"Training in progress, step {self.state.global_step}"
|
||||
else:
|
||||
commit_message = f"Training in progress, epoch {int(self.state.epoch)}"
|
||||
_, self.push_in_progress = self.repo.push_to_hub(
|
||||
commit_message=commit_message, blocking=False, auto_lfs_prune=True
|
||||
)
|
||||
push_work = self.repo.push_to_hub(commit_message=commit_message, blocking=False, auto_lfs_prune=True)
|
||||
# Return type of `Repository.push_to_hub` is either None or a tuple.
|
||||
if push_work is not None:
|
||||
self.push_in_progress = push_work[1]
|
||||
except Exception as e:
|
||||
logger.error(f"Error when pushing to hub: {e}")
|
||||
finally:
|
||||
|
|
|
|||
Loading…
Reference in a new issue