Skip to content

Commit

Permalink
another fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hanouticelina committed Nov 20, 2024
1 parent b9b3421 commit b66ba40
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/huggingface_hub/inference/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2895,12 +2895,12 @@ def zero_shot_image_classification(
self,
image: ContentT,
# temporarily keeping it optional for backward compatibility.
candidate_labels: Optional[List[str]] = None,
candidate_labels: List[str] = None, # type: ignore
*,
model: Optional[str] = None,
hypothesis_template: Optional[str] = None,
# deprecated argument
labels: Optional[List[str]] = None, # type: ignore
labels: List[str] = None, # type: ignore
) -> List[ZeroShotImageClassificationOutputElement]:
"""
Provide input image and text labels to predict text labels for the image.
Expand All @@ -2916,8 +2916,8 @@ def zero_shot_image_classification(
The model to use for inference. Can be a model ID hosted on the Hugging Face Hub or a URL to a deployed
Inference Endpoint. This parameter overrides the model defined at the instance level. If not provided, the default recommended zero-shot image classification model will be used.
hypothesis_template (`str`, *optional*):
The sentence used in conjunction with candidateLabels to attempt the text classification by replacing
the placeholder with the candidate labels.
The sentence used in conjunction with `candidate_labels` to attempt the image classification by
replacing the placeholder with the candidate labels.
Returns:
`List[ZeroShotImageClassificationOutputElement]`: List of [`ZeroShotImageClassificationOutputElement`] items containing the predicted labels and their confidence.
Expand Down
8 changes: 4 additions & 4 deletions src/huggingface_hub/inference/_generated/_async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2966,12 +2966,12 @@ async def zero_shot_image_classification(
self,
image: ContentT,
# temporarily keeping it optional for backward compatibility.
candidate_labels: Optional[List[str]] = None,
candidate_labels: List[str] = None, # type: ignore
*,
model: Optional[str] = None,
hypothesis_template: Optional[str] = None,
# deprecated argument
labels: Optional[List[str]] = None, # type: ignore
labels: List[str] = None, # type: ignore
) -> List[ZeroShotImageClassificationOutputElement]:
"""
Provide input image and text labels to predict text labels for the image.
Expand All @@ -2987,8 +2987,8 @@ async def zero_shot_image_classification(
The model to use for inference. Can be a model ID hosted on the Hugging Face Hub or a URL to a deployed
Inference Endpoint. This parameter overrides the model defined at the instance level. If not provided, the default recommended zero-shot image classification model will be used.
hypothesis_template (`str`, *optional*):
The sentence used in conjunction with candidateLabels to attempt the text classification by replacing
the placeholder with the candidate labels.
The sentence used in conjunction with `candidate_labels` to attempt the image classification by
replacing the placeholder with the candidate labels.
Returns:
`List[ZeroShotImageClassificationOutputElement]`: List of [`ZeroShotImageClassificationOutputElement`] items containing the predicted labels and their confidence.
Expand Down

0 comments on commit b66ba40

Please sign in to comment.