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

[Bot] Update inference types #2791

Merged
merged 4 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions docs/source/en/package_reference/inference_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,6 @@ This part of the lib is still under development and will be improved in future r

[[autodoc]] huggingface_hub.TextToImageParameters

[[autodoc]] huggingface_hub.TextToImageTargetSize



## text_to_speech
Expand Down
2 changes: 0 additions & 2 deletions docs/source/ko/package_reference/inference_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,6 @@ rendered properly in your Markdown viewer.

[[autodoc]] huggingface_hub.TextToImageParameters

[[autodoc]] huggingface_hub.TextToImageTargetSize



## text_to_speech[[huggingface_hub.TextToSpeechGenerationParameters]]
Expand Down
3 changes: 0 additions & 3 deletions src/huggingface_hub/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,6 @@
"TextToImageInput",
"TextToImageOutput",
"TextToImageParameters",
"TextToImageTargetSize",
"TextToSpeechEarlyStoppingEnum",
"TextToSpeechGenerationParameters",
"TextToSpeechInput",
Expand Down Expand Up @@ -702,7 +701,6 @@
"TextToImageInput",
"TextToImageOutput",
"TextToImageParameters",
"TextToImageTargetSize",
"TextToSpeechEarlyStoppingEnum",
"TextToSpeechGenerationParameters",
"TextToSpeechInput",
Expand Down Expand Up @@ -1334,7 +1332,6 @@ def __dir__():
TextToImageInput, # noqa: F401
TextToImageOutput, # noqa: F401
TextToImageParameters, # noqa: F401
TextToImageTargetSize, # noqa: F401
TextToSpeechEarlyStoppingEnum, # noqa: F401
TextToSpeechGenerationParameters, # noqa: F401
TextToSpeechInput, # noqa: F401
Expand Down
12 changes: 6 additions & 6 deletions src/huggingface_hub/inference/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2395,8 +2395,8 @@ def text_to_image(
prompt: str,
*,
negative_prompt: Optional[str] = None,
height: Optional[float] = None,
width: Optional[float] = None,
height: Optional[int] = None,
width: Optional[int] = None,
num_inference_steps: Optional[int] = None,
guidance_scale: Optional[float] = None,
model: Optional[str] = None,
Expand All @@ -2422,10 +2422,10 @@ def text_to_image(
The prompt to generate an image from.
negative_prompt (`str`, *optional*):
One prompt to guide what NOT to include in image generation.
height (`float`, *optional*):
The height in pixels of the image to generate.
width (`float`, *optional*):
The width in pixels of the image to generate.
height (`int`, *optional*):
The height in pixels of the output image
width (`int`, *optional*):
The width in pixels of the output image
num_inference_steps (`int`, *optional*):
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.
Expand Down
12 changes: 6 additions & 6 deletions src/huggingface_hub/inference/_generated/_async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2451,8 +2451,8 @@ async def text_to_image(
prompt: str,
*,
negative_prompt: Optional[str] = None,
height: Optional[float] = None,
width: Optional[float] = None,
height: Optional[int] = None,
width: Optional[int] = None,
num_inference_steps: Optional[int] = None,
guidance_scale: Optional[float] = None,
model: Optional[str] = None,
Expand All @@ -2478,10 +2478,10 @@ async def text_to_image(
The prompt to generate an image from.
negative_prompt (`str`, *optional*):
One prompt to guide what NOT to include in image generation.
height (`float`, *optional*):
The height in pixels of the image to generate.
width (`float`, *optional*):
The width in pixels of the image to generate.
height (`int`, *optional*):
The height in pixels of the output image
width (`int`, *optional*):
The width in pixels of the output image
num_inference_steps (`int`, *optional*):
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.
Expand Down
2 changes: 1 addition & 1 deletion src/huggingface_hub/inference/_generated/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
TextToAudioOutput,
TextToAudioParameters,
)
from .text_to_image import TextToImageInput, TextToImageOutput, TextToImageParameters, TextToImageTargetSize
from .text_to_image import TextToImageInput, TextToImageOutput, TextToImageParameters
from .text_to_speech import (
TextToSpeechEarlyStoppingEnum,
TextToSpeechGenerationParameters,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# - script: https://github.com/huggingface/huggingface.js/blob/main/packages/tasks/scripts/inference-codegen.ts
# - specs: https://github.com/huggingface/huggingface.js/tree/main/packages/tasks/src/tasks.
from dataclasses import dataclass
from typing import Literal, Optional
from typing import List, Literal, Optional, Union

from .base import BaseInferenceType

Expand All @@ -20,8 +20,8 @@ class FeatureExtractionInput(BaseInferenceType):
https://github.com/huggingface/huggingface.js/blob/main/packages/tasks/scripts/inference-tei-import.ts.
"""

inputs: str
"""The text to embed."""
inputs: Union[List[str], str]
"""The text or list of texts to embed."""
normalize: Optional[bool] = None
prompt_name: Optional[str] = None
"""The name of the prompt that should be used by for encoding. If not set, no prompt
Expand Down
12 changes: 4 additions & 8 deletions src/huggingface_hub/inference/_generated/types/text_to_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@
from .base import BaseInferenceType


@dataclass
class TextToImageTargetSize(BaseInferenceType):
"""The size in pixel of the output image"""

height: int
width: int


@dataclass
class TextToImageParameters(BaseInferenceType):
"""Additional inference parameters for Text To Image"""
Expand All @@ -25,6 +17,8 @@ class TextToImageParameters(BaseInferenceType):
"""A higher guidance scale value encourages the model to generate images closely linked to
the text prompt, but values too high may cause saturation and other artifacts.
"""
height: Optional[int] = None
"""The height in pixels of the output image"""
negative_prompt: Optional[str] = None
"""One prompt to guide what NOT to include in image generation."""
num_inference_steps: Optional[int] = None
Expand All @@ -35,6 +29,8 @@ class TextToImageParameters(BaseInferenceType):
"""Override the scheduler with a compatible one."""
seed: Optional[int] = None
"""Seed for the random number generator."""
width: Optional[int] = None
"""The width in pixels of the output image"""


@dataclass
Expand Down
Loading