Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/huggingface_hub/inference/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3196,10 +3196,7 @@ def zero_shot_classification(
)
response = self._inner_post(request_parameters)
output = _bytes_to_dict(response)
return [
ZeroShotClassificationOutputElement.parse_obj_as_instance({"label": label, "score": score})
for label, score in zip(output["labels"], output["scores"])
]
return ZeroShotClassificationOutputElement.parse_obj_as_list(output)

def zero_shot_image_classification(
self,
Expand Down
5 changes: 1 addition & 4 deletions src/huggingface_hub/inference/_generated/_async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3246,10 +3246,7 @@ async def zero_shot_classification(
)
response = await self._inner_post(request_parameters)
output = _bytes_to_dict(response)
return [
ZeroShotClassificationOutputElement.parse_obj_as_instance({"label": label, "score": score})
for label, score in zip(output["labels"], output["scores"])
]
return ZeroShotClassificationOutputElement.parse_obj_as_list(output)

async def zero_shot_image_classification(
self,
Expand Down
Loading