fix errors for lm_finetuning examples

This commit is contained in:
yzy5630
2019-07-17 09:56:07 +08:00
parent 60a1bdcdac
commit 123da5a2fa

View File

@@ -325,6 +325,7 @@ def main():
global_step += 1 global_step += 1
# Save a trained model # Save a trained model
if torch.distributed.get_rank() == 0:
logging.info("** ** * Saving fine-tuned model ** ** * ") logging.info("** ** * Saving fine-tuned model ** ** * ")
model_to_save = model.module if hasattr(model, 'module') else model # Only save the model it-self model_to_save = model.module if hasattr(model, 'module') else model # Only save the model it-self