Skip to content

Commit

Permalink
Fixed bug in comet score.
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelNiklaus committed Jan 27, 2025
1 parent 306ee76 commit 866e770
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion community_tasks/swiss_legal_evals.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,10 @@ def compute(
predictions = [response[0].result for response in responses]
sources = [kwargs["formatted_doc"].specific["source"] for kwargs["formatted_doc"] in formatted_docs]

data = [{"src": src, "mt": pred, "ref": gold} for src, pred, gold in zip(sources, predictions, golds)]
data = [
{"src": src, "mt": pred if isinstance(pred, str) else pred[0], "ref": gold}
for src, pred, gold in zip(sources, predictions, golds)
]
model_output = self.model.predict(
data,
batch_size=self.batch_size,
Expand Down

0 comments on commit 866e770

Please sign in to comment.