Skip to content

Commit

Permalink
Chunk dev data into batches of args['batch_size']
Browse files Browse the repository at this point in the history
  • Loading branch information
AngledLuffa committed Oct 22, 2023
1 parent f450f3b commit f9897ae
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions stanza/models/tagger.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,7 @@ def train(args):
for i in train_data]
dev_doc = CoNLL.conll2doc(input_file=args['eval_file'])
dev_data = Dataset(dev_doc, args, pretrain, vocab=vocab, evaluation=True, sort_during_eval=True)
# we want to put the entirety of the dev data into one batch
dev_batch = [next(iter(dev_data.to_loader(batch_size=len(dev_data), shuffle=True)))]
dev_batch = dev_data.to_loader(batch_size=args["batch_size"])

eval_type = get_eval_type(dev_data)

Expand Down

0 comments on commit f9897ae

Please sign in to comment.