Commit 6fc3d34a authored by Peter Izsak's avatar Peter Izsak Committed by Lysandre Debut
Browse files

Fix multi-gpu evaluation in run_glue.py

parent 7748cbbe
......@@ -310,7 +310,7 @@ def evaluate(args, model, tokenizer, prefix=""):
eval_dataloader = DataLoader(eval_dataset, sampler=eval_sampler, batch_size=args.eval_batch_size)
# multi-gpu eval
if args.n_gpu > 1:
if args.n_gpu > 1 and not isinstance(model, torch.nn.DataParallel):
model = torch.nn.DataParallel(model)
# Eval!
......
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