Unverified Commit 936b5715 authored by Sylvain Gugger's avatar Sylvain Gugger Committed by GitHub
Browse files

Use new evaluation loop in TrainerQA (#11746)

parent 73893fc7
......@@ -39,8 +39,9 @@ class QuestionAnsweringTrainer(Trainer):
# Temporarily disable metric computation, we will do it in the loop here.
compute_metrics = self.compute_metrics
self.compute_metrics = None
eval_loop = self.prediction_loop if self.args.use_legacy_prediction_loop else self.evaluation_loop
try:
output = self.prediction_loop(
output = eval_loop(
eval_dataloader,
description="Evaluation",
# No point gathering the predictions if there are no metrics, otherwise we defer to
......@@ -72,8 +73,9 @@ class QuestionAnsweringTrainer(Trainer):
# Temporarily disable metric computation, we will do it in the loop here.
compute_metrics = self.compute_metrics
self.compute_metrics = None
eval_loop = self.prediction_loop if self.args.use_legacy_prediction_loop else self.evaluation_loop
try:
output = self.prediction_loop(
output = eval_loop(
predict_dataloader,
description="Prediction",
# No point gathering the predictions if there are no metrics, otherwise we defer to
......
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