File tree Expand file tree Collapse file tree 2 files changed +2
-8
lines changed
src/huggingface_hub/inference Expand file tree Collapse file tree 2 files changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -3196,10 +3196,7 @@ def zero_shot_classification(
31963196 )
31973197 response = self ._inner_post (request_parameters )
31983198 output = _bytes_to_dict (response )
3199- return [
3200- ZeroShotClassificationOutputElement .parse_obj_as_instance ({"label" : label , "score" : score })
3201- for label , score in zip (output ["labels" ], output ["scores" ])
3202- ]
3199+ return ZeroShotClassificationOutputElement .parse_obj_as_list (output )
32033200
32043201 def zero_shot_image_classification (
32053202 self ,
Original file line number Diff line number Diff line change @@ -3246,10 +3246,7 @@ async def zero_shot_classification(
32463246 )
32473247 response = await self ._inner_post (request_parameters )
32483248 output = _bytes_to_dict (response )
3249- return [
3250- ZeroShotClassificationOutputElement .parse_obj_as_instance ({"label" : label , "score" : score })
3251- for label , score in zip (output ["labels" ], output ["scores" ])
3252- ]
3249+ return ZeroShotClassificationOutputElement .parse_obj_as_list (output )
32533250
32543251 async def zero_shot_image_classification (
32553252 self ,
You can’t perform that action at this time.
0 commit comments