Skip to content

Commit

Permalink
Ensure that textcat tasks scores are always a float (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
svlandeg authored May 11, 2023
1 parent cde7eeb commit 1217ca6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion spacy_llm/tasks/textcat.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def _format_response(self, response: str) -> Dict[str, float]:
categories = {label: score}
else:
# Multilabel classification
categories = {label: 0 for label in self._label_dict.values()}
categories = {label: 0.0 for label in self._label_dict.values()}

pred_labels = response.split(",")
if self._exclusive_classes and len(pred_labels) > 1:
Expand Down

0 comments on commit 1217ca6

Please sign in to comment.