From 61ef96849870c45eeebbf1eb561f48ca5cee353f Mon Sep 17 00:00:00 2001 From: HJ <92386084+JJJYmmm@users.noreply.github.com> Date: Wed, 24 Apr 2024 14:15:27 +0800 Subject: [PATCH] Update evaluate.py Fix the conditional determination of whether the scores variable is empty. --- evaluate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evaluate.py b/evaluate.py index 03da82e8..4718bcc5 100644 --- a/evaluate.py +++ b/evaluate.py @@ -164,7 +164,7 @@ def main(cfg: DictConfig, **kwargs): result, scores = eval_step( task, generator, models, sample, **kwargs) results += result - if scores and isinstance(scores[0], tuple): + if scores is not None and isinstance(scores[0], tuple): score_sum += sum([s[0] for s in scores]) score_cnt += sum([s[1] for s in scores]) else: