Skip to content

Commit

Permalink
Merge branch 'update-inference-types-automated-pr' of github.com:hugg…
Browse files Browse the repository at this point in the history
…ingface/huggingface_hub into update-inference-types-automated-pr
  • Loading branch information
hanouticelina committed Nov 21, 2024
2 parents 690decf + 05df70f commit d274efb
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/huggingface_hub/inference/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ def audio_classification(
top_k (`int`, *optional*):
When specified, limits the output to the top K most probable classes.
function_to_apply (`"AudioClassificationOutputTransform"`, *optional*):
The function to apply to the model outputs in order to retrieve the scores.
Returns:
`List[AudioClassificationOutputElement]`: List of [`AudioClassificationOutputElement`] items containing the predicted labels and their confidence.
Expand Down Expand Up @@ -1130,6 +1131,7 @@ def image_classification(
The model to use for image classification. Can be a model ID hosted on the Hugging Face Hub or a URL to a
deployed Inference Endpoint. If not provided, the default recommended model for image classification will be used.
function_to_apply (`"ImageClassificationOutputTransform"`, *optional*):
The function to apply to the model outputs in order to retrieve the scores.
top_k (`int`, *optional*):
When specified, limits the output to the top K most probable classes.
Returns:
Expand Down Expand Up @@ -1812,6 +1814,7 @@ def text_classification(
top_k (`int`, *optional*):
When specified, limits the output to the top K most probable classes.
function_to_apply (`"TextClassificationOutputTransform"`, *optional*):
The function to apply to the model outputs in order to retrieve the scores.
Returns:
`List[TextClassificationOutputElement]`: a list of [`TextClassificationOutputElement`] items containing the predicted label and associated probability.
Expand Down
3 changes: 3 additions & 0 deletions src/huggingface_hub/inference/_generated/_async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ async def audio_classification(
top_k (`int`, *optional*):
When specified, limits the output to the top K most probable classes.
function_to_apply (`"AudioClassificationOutputTransform"`, *optional*):
The function to apply to the model outputs in order to retrieve the scores.
Returns:
`List[AudioClassificationOutputElement]`: List of [`AudioClassificationOutputElement`] items containing the predicted labels and their confidence.
Expand Down Expand Up @@ -1175,6 +1176,7 @@ async def image_classification(
The model to use for image classification. Can be a model ID hosted on the Hugging Face Hub or a URL to a
deployed Inference Endpoint. If not provided, the default recommended model for image classification will be used.
function_to_apply (`"ImageClassificationOutputTransform"`, *optional*):
The function to apply to the model outputs in order to retrieve the scores.
top_k (`int`, *optional*):
When specified, limits the output to the top K most probable classes.
Returns:
Expand Down Expand Up @@ -1874,6 +1876,7 @@ async def text_classification(
top_k (`int`, *optional*):
When specified, limits the output to the top K most probable classes.
function_to_apply (`"TextClassificationOutputTransform"`, *optional*):
The function to apply to the model outputs in order to retrieve the scores.
Returns:
`List[TextClassificationOutputElement]`: a list of [`TextClassificationOutputElement`] items containing the predicted label and associated probability.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class AudioClassificationParameters(BaseInferenceType):
"""

function_to_apply: Optional["AudioClassificationOutputTransform"] = None
"""The function to apply to the model outputs in order to retrieve the scores."""
top_k: Optional[int] = None
"""When specified, limits the output to the top K most probable classes."""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class ImageClassificationParameters(BaseInferenceType):
"""

function_to_apply: Optional["ImageClassificationOutputTransform"] = None
"""The function to apply to the model outputs in order to retrieve the scores."""
top_k: Optional[int] = None
"""When specified, limits the output to the top K most probable classes."""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class TextClassificationParameters(BaseInferenceType):
"""

function_to_apply: Optional["TextClassificationOutputTransform"] = None
"""The function to apply to the model outputs in order to retrieve the scores."""
top_k: Optional[int] = None
"""When specified, limits the output to the top K most probable classes."""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class VideoClassificationParameters(BaseInferenceType):
frame_sampling_rate: Optional[int] = None
"""The sampling rate used to select frames from the video."""
function_to_apply: Optional["VideoClassificationOutputTransform"] = None
"""The function to apply to the model outputs in order to retrieve the scores."""
num_frames: Optional[int] = None
"""The number of sampled frames to consider for classification."""
top_k: Optional[int] = None
Expand Down

0 comments on commit d274efb

Please sign in to comment.