Skip to content

Commit 20510ec

Browse files
authored
SetFit: Cast probabilities to float & increment version (#411)
* Cast output values to float * Increment SetFit version to most recent
1 parent 5d72b59 commit 20510ec

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

docker_images/setfit/app/pipelines/text_classification.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def __call__(self, inputs: str) -> List[Dict[str, float]]:
2626
id2label = getattr(self.model, "id2label", {}) or {}
2727
return [
2828
[
29-
{"label": id2label.get(idx, idx), "score": prob}
29+
{"label": id2label.get(idx, idx), "score": float(prob)}
3030
for idx, prob in enumerate(probs[0])
3131
]
3232
]

docker_images/setfit/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
starlette==0.27.0
22
git+https://github.com/huggingface/api-inference-community.git@f06a71e72e92caeebabaeced979eacb3542bf2ca
33
huggingface_hub==0.20.2
4-
setfit==1.0.1
4+
setfit==1.0.3

0 commit comments

Comments
 (0)