Skip to content

Commit

Permalink
SetFit: Cast probabilities to float & increment version (#411)
Browse files Browse the repository at this point in the history
* Cast output values to float

* Increment SetFit version to most recent
  • Loading branch information
tomaarsen authored Mar 4, 2024
1 parent 5d72b59 commit 20510ec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docker_images/setfit/app/pipelines/text_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def __call__(self, inputs: str) -> List[Dict[str, float]]:
id2label = getattr(self.model, "id2label", {}) or {}
return [
[
{"label": id2label.get(idx, idx), "score": prob}
{"label": id2label.get(idx, idx), "score": float(prob)}
for idx, prob in enumerate(probs[0])
]
]
2 changes: 1 addition & 1 deletion docker_images/setfit/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
starlette==0.27.0
git+https://github.com/huggingface/api-inference-community.git@f06a71e72e92caeebabaeced979eacb3542bf2ca
huggingface_hub==0.20.2
setfit==1.0.1
setfit==1.0.3

0 comments on commit 20510ec

Please sign in to comment.