Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[InferenceClient] Automatically handle outdated task parameters #2633

Merged
merged 11 commits into from
Nov 18, 2024
2 changes: 1 addition & 1 deletion .github/workflows/python-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- run: .venv/bin/python utils/check_static_imports.py
- run: .venv/bin/python utils/generate_async_inference_client.py
- run: .venv/bin/python utils/generate_inference_types.py
- run: .venv/bin/python utils/generate_task_parameters.py
- run: .venv/bin/python utils/check_task_parameters.py

# Run type checking at least on huggingface_hub root file to check all modules
# that can be lazy-loaded actually exist.
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ style:

inference_check:
python utils/generate_inference_types.py
python utils/generate_task_parameters.py
python utils/check_task_parameters.py

inference_update:
python utils/generate_inference_types.py --update
python utils/generate_task_parameters.py --update
python utils/check_task_parameters.py --update


repocard:
Expand Down
20 changes: 20 additions & 0 deletions src/huggingface_hub/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,10 @@
"ChatCompletionInputFunctionDefinition",
"ChatCompletionInputFunctionName",
"ChatCompletionInputGrammarType",
"ChatCompletionInputGrammarTypeType",
"ChatCompletionInputMessage",
"ChatCompletionInputMessageChunk",
"ChatCompletionInputMessageChunkType",
"ChatCompletionInputStreamOptions",
"ChatCompletionInputToolType",
"ChatCompletionInputURL",
Expand Down Expand Up @@ -322,6 +324,7 @@
"DocumentQuestionAnsweringOutputElement",
"DocumentQuestionAnsweringParameters",
"FeatureExtractionInput",
"FeatureExtractionInputTruncationDirection",
"FillMaskInput",
"FillMaskOutputElement",
"FillMaskParameters",
Expand All @@ -332,6 +335,7 @@
"ImageSegmentationInput",
"ImageSegmentationOutputElement",
"ImageSegmentationParameters",
"ImageSegmentationSubtask",
"ImageToImageInput",
"ImageToImageOutput",
"ImageToImageParameters",
Expand All @@ -354,12 +358,14 @@
"SummarizationInput",
"SummarizationOutput",
"SummarizationParameters",
"SummarizationTruncationStrategy",
"TableQuestionAnsweringInput",
"TableQuestionAnsweringInputData",
"TableQuestionAnsweringOutputElement",
"Text2TextGenerationInput",
"Text2TextGenerationOutput",
"Text2TextGenerationParameters",
"Text2TextGenerationTruncationStrategy",
"TextClassificationInput",
"TextClassificationOutputElement",
"TextClassificationOutputTransform",
Expand All @@ -370,6 +376,7 @@
"TextGenerationOutput",
"TextGenerationOutputBestOfSequence",
"TextGenerationOutputDetails",
"TextGenerationOutputFinishReason",
"TextGenerationOutputPrefillToken",
"TextGenerationOutputToken",
"TextGenerationStreamOutput",
Expand All @@ -389,13 +396,16 @@
"TextToSpeechInput",
"TextToSpeechOutput",
"TextToSpeechParameters",
"TokenClassificationAggregationStrategy",
"TokenClassificationInput",
"TokenClassificationOutputElement",
"TokenClassificationParameters",
"ToolElement",
"TranslationInput",
"TranslationOutput",
"TranslationParameters",
"TranslationTruncationStrategy",
"TypeEnum",
"VideoClassificationInput",
"VideoClassificationOutputElement",
"VideoClassificationOutputTransform",
Expand Down Expand Up @@ -812,8 +822,10 @@ def __dir__():
ChatCompletionInputFunctionDefinition, # noqa: F401
ChatCompletionInputFunctionName, # noqa: F401
ChatCompletionInputGrammarType, # noqa: F401
ChatCompletionInputGrammarTypeType, # noqa: F401
ChatCompletionInputMessage, # noqa: F401
ChatCompletionInputMessageChunk, # noqa: F401
ChatCompletionInputMessageChunkType, # noqa: F401
ChatCompletionInputStreamOptions, # noqa: F401
ChatCompletionInputToolType, # noqa: F401
ChatCompletionInputURL, # noqa: F401
Expand Down Expand Up @@ -842,6 +854,7 @@ def __dir__():
DocumentQuestionAnsweringOutputElement, # noqa: F401
DocumentQuestionAnsweringParameters, # noqa: F401
FeatureExtractionInput, # noqa: F401
FeatureExtractionInputTruncationDirection, # noqa: F401
FillMaskInput, # noqa: F401
FillMaskOutputElement, # noqa: F401
FillMaskParameters, # noqa: F401
Expand All @@ -852,6 +865,7 @@ def __dir__():
ImageSegmentationInput, # noqa: F401
ImageSegmentationOutputElement, # noqa: F401
ImageSegmentationParameters, # noqa: F401
ImageSegmentationSubtask, # noqa: F401
ImageToImageInput, # noqa: F401
ImageToImageOutput, # noqa: F401
ImageToImageParameters, # noqa: F401
Expand All @@ -874,12 +888,14 @@ def __dir__():
SummarizationInput, # noqa: F401
SummarizationOutput, # noqa: F401
SummarizationParameters, # noqa: F401
SummarizationTruncationStrategy, # noqa: F401
TableQuestionAnsweringInput, # noqa: F401
TableQuestionAnsweringInputData, # noqa: F401
TableQuestionAnsweringOutputElement, # noqa: F401
Text2TextGenerationInput, # noqa: F401
Text2TextGenerationOutput, # noqa: F401
Text2TextGenerationParameters, # noqa: F401
Text2TextGenerationTruncationStrategy, # noqa: F401
TextClassificationInput, # noqa: F401
TextClassificationOutputElement, # noqa: F401
TextClassificationOutputTransform, # noqa: F401
Expand All @@ -890,6 +906,7 @@ def __dir__():
TextGenerationOutput, # noqa: F401
TextGenerationOutputBestOfSequence, # noqa: F401
TextGenerationOutputDetails, # noqa: F401
TextGenerationOutputFinishReason, # noqa: F401
TextGenerationOutputPrefillToken, # noqa: F401
TextGenerationOutputToken, # noqa: F401
TextGenerationStreamOutput, # noqa: F401
Expand All @@ -909,13 +926,16 @@ def __dir__():
TextToSpeechInput, # noqa: F401
TextToSpeechOutput, # noqa: F401
TextToSpeechParameters, # noqa: F401
TokenClassificationAggregationStrategy, # noqa: F401
TokenClassificationInput, # noqa: F401
TokenClassificationOutputElement, # noqa: F401
TokenClassificationParameters, # noqa: F401
ToolElement, # noqa: F401
TranslationInput, # noqa: F401
TranslationOutput, # noqa: F401
TranslationParameters, # noqa: F401
TranslationTruncationStrategy, # noqa: F401
TypeEnum, # noqa: F401
VideoClassificationInput, # noqa: F401
VideoClassificationOutputElement, # noqa: F401
VideoClassificationOutputTransform, # noqa: F401
Expand Down
Loading
Loading