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 22, 2024
2 parents d274efb + 33840be commit 817dafb
Show file tree
Hide file tree
Showing 33 changed files with 94 additions and 114 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
<p align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://huggingface.co/datasets/huggingface/documentation-images/raw/main/huggingface_hub-dark.svg">
<source media="(prefers-color-scheme: light)" srcset="https://huggingface.co/datasets/huggingface/documentation-images/raw/main/huggingface_hub.svg">
<img alt="huggingface_hub library logo" src="https://huggingface.co/datasets/huggingface/documentation-images/raw/main/huggingface_hub.svg" width="352" height="59" style="max-width: 100%;">
</picture>
<br/>
<img alt="huggingface_hub library logo" src="https://huggingface.co/datasets/huggingface/documentation-images/raw/main/huggingface_hub.svg" width="376" height="59" style="max-width: 100%;">
<br/>
</p>
</p>

<p align="center">
<i>The official Python client for the Huggingface Hub.</i>
Expand Down
8 changes: 6 additions & 2 deletions i18n/README_cn.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
<p align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://huggingface.co/datasets/huggingface/documentation-images/raw/main/huggingface_hub-dark.svg">
<source media="(prefers-color-scheme: light)" srcset="https://huggingface.co/datasets/huggingface/documentation-images/raw/main/huggingface_hub.svg">
<img alt="huggingface_hub library logo" src="https://huggingface.co/datasets/huggingface/documentation-images/raw/main/huggingface_hub.svg" width="352" height="59" style="max-width: 100%;">
</picture>
<br/>
<img alt="huggingface_hub library logo" src="https://huggingface.co/datasets/huggingface/documentation-images/raw/main/huggingface_hub.svg" width="376" height="59" style="max-width: 100%;">
<br/>
</p>
</p>

<p align="center">
<i>Hugging Face Hub Python 客户端</i>
Expand Down
8 changes: 6 additions & 2 deletions i18n/README_de.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
<p align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://huggingface.co/datasets/huggingface/documentation-images/raw/main/huggingface_hub-dark.svg">
<source media="(prefers-color-scheme: light)" srcset="https://huggingface.co/datasets/huggingface/documentation-images/raw/main/huggingface_hub.svg">
<img alt="huggingface_hub library logo" src="https://huggingface.co/datasets/huggingface/documentation-images/raw/main/huggingface_hub.svg" width="352" height="59" style="max-width: 100%;">
</picture>
<br/>
<img alt="huggingface_hub library logo" src="https://huggingface.co/datasets/huggingface/documentation-images/raw/main/huggingface_hub.svg" width="376" height="59" style="max-width: 100%;">
<br/>
</p>
</p>

<p align="center">
<i>Der offizielle Python-Client für den Huggingface Hub.</i>
Expand Down
8 changes: 6 additions & 2 deletions i18n/README_hi.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
<p align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://huggingface.co/datasets/huggingface/documentation-images/raw/main/huggingface_hub-dark.svg">
<source media="(prefers-color-scheme: light)" srcset="https://huggingface.co/datasets/huggingface/documentation-images/raw/main/huggingface_hub.svg">
<img alt="huggingface_hub library logo" src="https://huggingface.co/datasets/huggingface/documentation-images/raw/main/huggingface_hub.svg" width="352" height="59" style="max-width: 100%;">
</picture>
<br/>
<img alt="huggingface_hub library logo" src="https://huggingface.co/datasets/huggingface/documentation-images/raw/main/huggingface_hub.svg" width="376" height="59" style="max-width: 100%;">
<br/>
</p>
</p>

<p align="center">
<i>Huggingface Hub के लिए आधिकारिक पायथन क्लाइंट।</i>
Expand Down
8 changes: 6 additions & 2 deletions i18n/README_ko.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
<p align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://huggingface.co/datasets/huggingface/documentation-images/raw/main/huggingface_hub-dark.svg">
<source media="(prefers-color-scheme: light)" srcset="https://huggingface.co/datasets/huggingface/documentation-images/raw/main/huggingface_hub.svg">
<img alt="huggingface_hub library logo" src="https://huggingface.co/datasets/huggingface/documentation-images/raw/main/huggingface_hub.svg" width="352" height="59" style="max-width: 100%;">
</picture>
<br/>
<img alt="huggingface_hub library logo" src="https://huggingface.co/datasets/huggingface/documentation-images/raw/main/huggingface_hub.svg" width="376" height="59" style="max-width: 100%;">
<br/>
</p>
</p>

<p align="center">
<i>공식 Huggingface Hub 파이썬 클라이언트</i>
Expand Down
2 changes: 1 addition & 1 deletion src/huggingface_hub/inference/_generated/_async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ async def post(
logger.info(f"Waiting for model to be loaded on the server: {error}")
if "X-wait-for-model" not in headers and url.startswith(INFERENCE_ENDPOINT):
headers["X-wait-for-model"] = "1"
time.sleep(1)
await asyncio.sleep(1)
if timeout is not None:
timeout = max(self.timeout - (time.time() - t0), 1) # type: ignore
continue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@

@dataclass
class AudioClassificationParameters(BaseInferenceType):
"""Additional inference parameters
Additional inference parameters for Audio Classification
"""
"""Additional inference parameters for Audio Classification"""

function_to_apply: Optional["AudioClassificationOutputTransform"] = None
"""The function to apply to the model outputs in order to retrieve the scores."""
Expand All @@ -33,7 +31,7 @@ class AudioClassificationInput(BaseInferenceType):
also provide the audio data as a raw bytes payload.
"""
parameters: Optional[AudioClassificationParameters] = None
"""Additional inference parameters"""
"""Additional inference parameters for Audio Classification"""


@dataclass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@

@dataclass
class AutomaticSpeechRecognitionGenerationParameters(BaseInferenceType):
"""Parametrization of the text generation process
Ad-hoc parametrization of the text generation process
"""
"""Parametrization of the text generation process"""

do_sample: Optional[bool] = None
"""Whether to use sampling instead of greedy decoding when generating new tokens."""
Expand Down Expand Up @@ -76,9 +74,7 @@ class AutomaticSpeechRecognitionGenerationParameters(BaseInferenceType):

@dataclass
class AutomaticSpeechRecognitionParameters(BaseInferenceType):
"""Additional inference parameters
Additional inference parameters for Automatic Speech Recognition
"""
"""Additional inference parameters for Automatic Speech Recognition"""

generation_parameters: Optional[AutomaticSpeechRecognitionGenerationParameters] = None
"""Parametrization of the text generation process"""
Expand All @@ -95,7 +91,7 @@ class AutomaticSpeechRecognitionInput(BaseInferenceType):
also provide the audio data as a raw bytes payload.
"""
parameters: Optional[AutomaticSpeechRecognitionParameters] = None
"""Additional inference parameters"""
"""Additional inference parameters for Automatic Speech Recognition"""


@dataclass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class DepthEstimationInput(BaseInferenceType):
inputs: Any
"""The input image data"""
parameters: Optional[Dict[str, Any]] = None
"""Additional inference parameters"""
"""Additional inference parameters for Depth Estimation"""


@dataclass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ class DocumentQuestionAnsweringInputData(BaseInferenceType):

@dataclass
class DocumentQuestionAnsweringParameters(BaseInferenceType):
"""Additional inference parameters
Additional inference parameters for Document Question Answering
"""
"""Additional inference parameters for Document Question Answering"""

doc_stride: Optional[int] = None
"""If the words in the document are too long to fit with the question for the model, it will
Expand Down Expand Up @@ -62,7 +60,7 @@ class DocumentQuestionAnsweringInput(BaseInferenceType):
inputs: DocumentQuestionAnsweringInputData
"""One (document, question) pair to answer"""
parameters: Optional[DocumentQuestionAnsweringParameters] = None
"""Additional inference parameters"""
"""Additional inference parameters for Document Question Answering"""


@dataclass
Expand Down
6 changes: 2 additions & 4 deletions src/huggingface_hub/inference/_generated/types/fill_mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@

@dataclass
class FillMaskParameters(BaseInferenceType):
"""Additional inference parameters
Additional inference parameters for Fill Mask
"""
"""Additional inference parameters for Fill Mask"""

targets: Optional[List[str]] = None
"""When passed, the model will limit the scores to the passed targets instead of looking up
Expand All @@ -32,7 +30,7 @@ class FillMaskInput(BaseInferenceType):
inputs: str
"""The text with masked tokens"""
parameters: Optional[FillMaskParameters] = None
"""Additional inference parameters"""
"""Additional inference parameters for Fill Mask"""


@dataclass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@

@dataclass
class ImageClassificationParameters(BaseInferenceType):
"""Additional inference parameters
Additional inference parameters for Image Classification
"""
"""Additional inference parameters for Image Classification"""

function_to_apply: Optional["ImageClassificationOutputTransform"] = None
"""The function to apply to the model outputs in order to retrieve the scores."""
Expand All @@ -33,7 +31,7 @@ class ImageClassificationInput(BaseInferenceType):
also provide the image data as a raw bytes payload.
"""
parameters: Optional[ImageClassificationParameters] = None
"""Additional inference parameters"""
"""Additional inference parameters for Image Classification"""


@dataclass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@

@dataclass
class ImageSegmentationParameters(BaseInferenceType):
"""Additional inference parameters
Additional inference parameters for Image Segmentation
"""
"""Additional inference parameters for Image Segmentation"""

mask_threshold: Optional[float] = None
"""Threshold to use when turning the predicted masks into binary values."""
Expand All @@ -37,7 +35,7 @@ class ImageSegmentationInput(BaseInferenceType):
also provide the image data as a raw bytes payload.
"""
parameters: Optional[ImageSegmentationParameters] = None
"""Additional inference parameters"""
"""Additional inference parameters for Image Segmentation"""


@dataclass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ class ImageToImageTargetSize(BaseInferenceType):

@dataclass
class ImageToImageParameters(BaseInferenceType):
"""Additional inference parameters
Additional inference parameters for Image To Image
"""
"""Additional inference parameters for Image To Image"""

guidance_scale: Optional[float] = None
"""For diffusion models. A higher guidance scale value encourages the model to generate
Expand All @@ -46,7 +44,7 @@ class ImageToImageInput(BaseInferenceType):
also provide the image data as a raw bytes payload.
"""
parameters: Optional[ImageToImageParameters] = None
"""Additional inference parameters"""
"""Additional inference parameters for Image To Image"""


@dataclass
Expand Down
10 changes: 3 additions & 7 deletions src/huggingface_hub/inference/_generated/types/image_to_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@

@dataclass
class ImageToTextGenerationParameters(BaseInferenceType):
"""Parametrization of the text generation process
Ad-hoc parametrization of the text generation process
"""
"""Parametrization of the text generation process"""

do_sample: Optional[bool] = None
"""Whether to use sampling instead of greedy decoding when generating new tokens."""
Expand Down Expand Up @@ -76,9 +74,7 @@ class ImageToTextGenerationParameters(BaseInferenceType):

@dataclass
class ImageToTextParameters(BaseInferenceType):
"""Additional inference parameters
Additional inference parameters for Image To Text
"""
"""Additional inference parameters for Image To Text"""

generation_parameters: Optional[ImageToTextGenerationParameters] = None
"""Parametrization of the text generation process"""
Expand All @@ -93,7 +89,7 @@ class ImageToTextInput(BaseInferenceType):
inputs: Any
"""The input image data"""
parameters: Optional[ImageToTextParameters] = None
"""Additional inference parameters"""
"""Additional inference parameters for Image To Text"""


@dataclass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@

@dataclass
class ObjectDetectionParameters(BaseInferenceType):
"""Additional inference parameters
Additional inference parameters for Object Detection
"""
"""Additional inference parameters for Object Detection"""

threshold: Optional[float] = None
"""The probability necessary to make a prediction."""
Expand All @@ -28,7 +26,7 @@ class ObjectDetectionInput(BaseInferenceType):
also provide the image data as a raw bytes payload.
"""
parameters: Optional[ObjectDetectionParameters] = None
"""Additional inference parameters"""
"""Additional inference parameters for Object Detection"""


@dataclass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ class QuestionAnsweringInputData(BaseInferenceType):

@dataclass
class QuestionAnsweringParameters(BaseInferenceType):
"""Additional inference parameters
Additional inference parameters for Question Answering
"""
"""Additional inference parameters for Question Answering"""

align_to_words: Optional[bool] = None
"""Attempts to align the answer to real words. Improves quality on space separated
Expand Down Expand Up @@ -60,7 +58,7 @@ class QuestionAnsweringInput(BaseInferenceType):
inputs: QuestionAnsweringInputData
"""One (context, question) pair to answer"""
parameters: Optional[QuestionAnsweringParameters] = None
"""Additional inference parameters"""
"""Additional inference parameters for Question Answering"""


@dataclass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ class SentenceSimilarityInput(BaseInferenceType):

inputs: SentenceSimilarityInputData
parameters: Optional[Dict[str, Any]] = None
"""Additional inference parameters"""
"""Additional inference parameters for Sentence Similarity"""
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@

@dataclass
class SummarizationParameters(BaseInferenceType):
"""Additional inference parameters.
Additional inference parameters for summarization.
"""
"""Additional inference parameters for summarization."""

clean_up_tokenization_spaces: Optional[bool] = None
"""Whether to clean up the potential extra spaces in the text output."""
Expand All @@ -33,7 +31,7 @@ class SummarizationInput(BaseInferenceType):
inputs: str
"""The input text to summarize."""
parameters: Optional[SummarizationParameters] = None
"""Additional inference parameters."""
"""Additional inference parameters for summarization."""


@dataclass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class TableQuestionAnsweringInput(BaseInferenceType):
inputs: TableQuestionAnsweringInputData
"""One (table, question) pair to answer"""
parameters: Optional[Dict[str, Any]] = None
"""Additional inference parameters"""
"""Additional inference parameters for Table Question Answering"""


@dataclass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@

@dataclass
class Text2TextGenerationParameters(BaseInferenceType):
"""Additional inference parameters
Additional inference parameters for Text2text Generation
"""
"""Additional inference parameters for Text2text Generation"""

clean_up_tokenization_spaces: Optional[bool] = None
"""Whether to clean up the potential extra spaces in the text output."""
Expand All @@ -33,7 +31,7 @@ class Text2TextGenerationInput(BaseInferenceType):
inputs: str
"""The input text data"""
parameters: Optional[Text2TextGenerationParameters] = None
"""Additional inference parameters"""
"""Additional inference parameters for Text2text Generation"""


@dataclass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@

@dataclass
class TextClassificationParameters(BaseInferenceType):
"""Additional inference parameters
Additional inference parameters for Text Classification
"""
"""Additional inference parameters for Text Classification"""

function_to_apply: Optional["TextClassificationOutputTransform"] = None
"""The function to apply to the model outputs in order to retrieve the scores."""
Expand All @@ -31,7 +29,7 @@ class TextClassificationInput(BaseInferenceType):
inputs: str
"""The text to classify"""
parameters: Optional[TextClassificationParameters] = None
"""Additional inference parameters"""
"""Additional inference parameters for Text Classification"""


@dataclass
Expand Down
Loading

0 comments on commit 817dafb

Please sign in to comment.