From 31782da83c1c0c62e3557ed4d6a4aa79eb57d501 Mon Sep 17 00:00:00 2001 From: Jose Javier <26491792+josejg@users.noreply.github.com> Date: Tue, 6 Feb 2024 20:12:15 -0800 Subject: [PATCH] fix --- composer/metrics/nlp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer/metrics/nlp.py b/composer/metrics/nlp.py index c841acb8eb..a326d1a7dd 100644 --- a/composer/metrics/nlp.py +++ b/composer/metrics/nlp.py @@ -660,7 +660,7 @@ def compute(self): for k in self.pass_at_k: results[f'pass@{k}'] = sum([self.estimator(n, c.item(), k) for c in self.correct]) / dataset_size - if len(results) == 0: # backwards compatibility - return results[0] + if len(results) == 1: # backwards compatibility + return list(results.values())[0] return results