don't save model without training
This commit is contained in:
committed by
Julien Chaumond
parent
189ff9b664
commit
40acf6b52a
@@ -481,7 +481,7 @@ def main():
|
||||
|
||||
|
||||
# Save the trained model and the tokenizer
|
||||
if args.local_rank == -1 or torch.distributed.get_rank() == 0:
|
||||
if args.do_train and args.local_rank == -1 or torch.distributed.get_rank() == 0:
|
||||
# Create output directory if needed
|
||||
if not os.path.exists(args.output_dir) and args.local_rank in [-1, 0]:
|
||||
os.makedirs(args.output_dir)
|
||||
|
||||
Reference in New Issue
Block a user