From 8b5103bf6baedd9c243331f82581c8f96b9b6aba Mon Sep 17 00:00:00 2001 From: Yasmin Moslem <48152713+ymoslem@users.noreply.github.com> Date: Mon, 20 Nov 2023 23:33:44 +0000 Subject: [PATCH] Update base.py Fixes: AttributeError: 'dict' object has no attribute 'scores' Changed: ```scores = torch.cat([pred.scores for pred in predictions], dim=0).tolist() ``` to: ``` scores = torch.cat([pred["scores"] for pred in predictions], dim=0).tolist() ``` --- comet/models/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comet/models/base.py b/comet/models/base.py index 6a792aa..9067904 100644 --- a/comet/models/base.py +++ b/comet/models/base.py @@ -649,7 +649,7 @@ def predict( # If we are not in the GLOBAL RANK we will return None exit() - scores = torch.cat([pred.scores for pred in predictions], dim=0).tolist() + scores = torch.cat([pred["scores"] for pred in predictions], dim=0).tolist() if "metadata" in predictions[0]: metadata = flatten_metadata([pred.metadata for pred in predictions]) else: