Skip to content

Commit

Permalink
set max length / num beams according to gen kwargs
Browse files Browse the repository at this point in the history
  • Loading branch information
sanchit-gandhi committed Oct 13, 2022
1 parent f398822 commit ecd4e03
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ def compute_metrics(pred):
if training_args.do_eval:
logger.info("*** Evaluate ***")
metrics = trainer.evaluate(
metric_key_prefix="eval", max_length=model.config.max_length, num_beams=model.config.num_beams
metric_key_prefix="eval", max_length=training_args.generation_max_length, num_beams=training_args.generation_num_beams
)
max_eval_samples = (
data_args.max_eval_samples if data_args.max_eval_samples is not None else len(vectorized_datasets["eval"])
Expand Down

0 comments on commit ecd4e03

Please sign in to comment.