marinone94 commited on
Commit
ee5b1b2
1 Parent(s): 23bb45c

skip push to hub during training

Browse files
run_speech_recognition_seq2seq_streaming.py CHANGED
@@ -658,8 +658,14 @@ def main():
658
  train_result = trainer.train(resume_from_checkpoint=checkpoint)
659
  logger.info("*** Training completed ***")
660
  logger.info("*** Saving model ***")
 
 
 
 
 
661
  trainer.save_model() # Saves the feature extractor too for easy upload
662
- logger.info("*** Model saves ***")
 
663
  metrics = train_result.metrics
664
  if data_args.max_train_samples:
665
  metrics["train_samples"] = data_args.max_train_samples
 
658
  train_result = trainer.train(resume_from_checkpoint=checkpoint)
659
  logger.info("*** Training completed ***")
660
  logger.info("*** Saving model ***")
661
+ # We don't want to push the model to the hub now
662
+ # so we temporarily set to false the push_to_hub attribute
663
+ # and then reset it to the original value
664
+ orig_push_to_hub = trainer.args.push_to_hub
665
+ trainer.args.push_to_hub = False
666
  trainer.save_model() # Saves the feature extractor too for easy upload
667
+ trainer.args.push_to_hub = orig_push_to_hub
668
+ logger.info("*** Model saved ***")
669
  metrics = train_result.metrics
670
  if data_args.max_train_samples:
671
  metrics["train_samples"] = data_args.max_train_samples