Skip to content

Commit

Permalink
Fix it to work with BART (huggingface#6756)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomgrek authored and Zigur committed Oct 26, 2020
1 parent bcc65f7 commit d00833b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/question-answering/run_squad.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def train(args, train_dataset, model, tokenizer):
"end_positions": batch[4],
}

if args.model_type in ["xlm", "roberta", "distilbert", "camembert"]:
if args.model_type in ["xlm", "roberta", "distilbert", "camembert", "bart"]:
del inputs["token_type_ids"]

if args.model_type in ["xlnet", "xlm"]:
Expand Down Expand Up @@ -300,7 +300,7 @@ def evaluate(args, model, tokenizer, prefix=""):
"token_type_ids": batch[2],
}

if args.model_type in ["xlm", "roberta", "distilbert", "camembert"]:
if args.model_type in ["xlm", "roberta", "distilbert", "camembert", "bart"]:
del inputs["token_type_ids"]

feature_indices = batch[3]
Expand Down

0 comments on commit d00833b

Please sign in to comment.