Unverified Commit 7fa7408b authored by Matt's avatar Matt Committed by GitHub
Browse files

Terminate previous pushes when we get to the final push (#16409)

parent 867f3950
......@@ -370,7 +370,7 @@ class PushToHubCallback(Callback):
def on_train_end(self, logs=None):
if self.last_job is not None and not self.last_job.is_done:
logger.info("Waiting for existing upload to finish...")
self.last_job._process.terminate() # Gotta go fast
while not self.last_job.is_done:
sleep(1)
self.model.save_pretrained(self.output_dir)
......
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