Skip to content

Commit

Permalink
[InferenceClient] Keep generate_kwargs instead of `generation_param…
Browse files Browse the repository at this point in the history
…eters` (#2711)

* deprecate instead of removing generate_kwargs

* remove generation_parameters

* remove generation_parameters from other tasks
  • Loading branch information
hanouticelina authored Dec 16, 2024
1 parent 6be2b3e commit c4e6079
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,11 @@ class AutomaticSpeechRecognitionGenerationParameters(BaseInferenceType):
class AutomaticSpeechRecognitionParameters(BaseInferenceType):
"""Additional inference parameters for Automatic Speech Recognition"""

generation_parameters: Optional[AutomaticSpeechRecognitionGenerationParameters] = None
"""Parametrization of the text generation process"""
return_timestamps: Optional[bool] = None
"""Whether to output corresponding timestamps with the generated text"""
# Will be deprecated in the future when the renaming to `generation_parameters` is implemented in transformers
generate_kwargs: Optional[AutomaticSpeechRecognitionGenerationParameters] = None
"""Parametrization of the text generation process"""


@dataclass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,11 @@ class ImageToTextGenerationParameters(BaseInferenceType):
class ImageToTextParameters(BaseInferenceType):
"""Additional inference parameters for Image To Text"""

generation_parameters: Optional[ImageToTextGenerationParameters] = None
"""Parametrization of the text generation process"""
max_new_tokens: Optional[int] = None
"""The amount of maximum tokens to generate."""
# Will be deprecated in the future when the renaming to `generation_parameters` is implemented in transformers
generate_kwargs: Optional[ImageToTextGenerationParameters] = None
"""Parametrization of the text generation process"""


@dataclass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ class TextToAudioGenerationParameters(BaseInferenceType):
class TextToAudioParameters(BaseInferenceType):
"""Additional inference parameters for Text To Audio"""

generation_parameters: Optional[TextToAudioGenerationParameters] = None
# Will be deprecated in the future when the renaming to `generation_parameters` is implemented in transformers
generate_kwargs: Optional[TextToAudioGenerationParameters] = None
"""Parametrization of the text generation process"""


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ class TextToSpeechGenerationParameters(BaseInferenceType):
class TextToSpeechParameters(BaseInferenceType):
"""Additional inference parameters for Text To Speech"""

generation_parameters: Optional[TextToSpeechGenerationParameters] = None
# Will be deprecated in the future when the renaming to `generation_parameters` is implemented in transformers
generate_kwargs: Optional[TextToSpeechGenerationParameters] = None
"""Parametrization of the text generation process"""


Expand Down

0 comments on commit c4e6079

Please sign in to comment.