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 @@ -3195,10 +3195,7 @@ def zero_shot_classification(
31953195 )
31963196 response = self ._inner_post (request_parameters )
31973197 output = _bytes_to_dict (response )
3198- return [
3199- ZeroShotClassificationOutputElement .parse_obj_as_instance ({"label" : label , "score" : score })
3200- for label , score in zip (output ["labels" ], output ["scores" ])
3201- ]
3198+ return ZeroShotClassificationOutputElement .parse_obj_as_list (output )
32023199
32033200 def zero_shot_image_classification (
32043201 self ,
Original file line number Diff line number Diff line change @@ -3245,10 +3245,7 @@ async def zero_shot_classification(
32453245 )
32463246 response = await self ._inner_post (request_parameters )
32473247 output = _bytes_to_dict (response )
3248- return [
3249- ZeroShotClassificationOutputElement .parse_obj_as_instance ({"label" : label , "score" : score })
3250- for label , score in zip (output ["labels" ], output ["scores" ])
3251- ]
3248+ return ZeroShotClassificationOutputElement .parse_obj_as_list (output )
32523249
32533250 async def zero_shot_image_classification (
32543251 self ,
You can’t perform that action at this time.
0 commit comments