Skip to content

Commit

Permalink
Merge pull request #521 from dangne/master
Browse files Browse the repository at this point in the history
Fix a bug when running textattack eval with --num-examples=-1
  • Loading branch information
jxmorris12 committed Sep 24, 2021
2 parents cdfcba4 + 19148ea commit e7a824e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions textattack/commands/eval_model_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ def get_preds(self, model, inputs):
def test_model_on_dataset(self, args):
model = ModelArgs._create_model_from_args(args)
dataset = DatasetArgs._create_dataset_from_args(args)
if args.num_examples == -1:
args.num_examples = len(dataset)

preds = []
ground_truth_outputs = []
Expand Down

0 comments on commit e7a824e

Please sign in to comment.