don't save if do not train
This commit is contained in:
@@ -1010,6 +1010,7 @@ def main():
|
|||||||
# Save a trained model
|
# Save a trained 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
|
||||||
output_model_file = os.path.join(args.output_dir, "pytorch_model.bin")
|
output_model_file = os.path.join(args.output_dir, "pytorch_model.bin")
|
||||||
|
if args.do_train:
|
||||||
torch.save(model_to_save.state_dict(), output_model_file)
|
torch.save(model_to_save.state_dict(), output_model_file)
|
||||||
|
|
||||||
# Load a trained model that you have fine-tuned
|
# Load a trained model that you have fine-tuned
|
||||||
|
|||||||
Reference in New Issue
Block a user