Skip to content

pixano_inference.pydantic.tasks.multimodal.conditional_generation

Pydantic models for text-image conditional generation task.

TextImageConditionalGenerationInput

Bases: BaseModel

Input for text-image conditional generation.

Attributes:

Name Type Description
prompt str | list[dict[str, Any]]

Prompt for the generation. Can be a string or a list of dictionaries to apply a chat template.

images list[str | Path] | None

Images for the generation. Can be None if images are passed in the prompt.

max_new_tokens int

Maximum number of new tokens to generate.

temperature float

Temperature for the generation.

TextImageConditionalGenerationOutput

Bases: BaseModel

Output for text-image conditional generation.

Attributes:

Name Type Description
generated_text str

Generated text.

usage UsageConditionalGeneration

Usage of the model for the generation.

generation_config dict[str, Any]

Configuration for the generation.

TextImageConditionalGenerationRequest

Bases: BaseRequest, TextImageConditionalGenerationInput

Request for text-image conditional generation.

to_input()

Convert the request to the input.

Source code in pixano_inference/pydantic/tasks/multimodal/conditional_generation.py
def to_input(self) -> TextImageConditionalGenerationInput:
    """Convert the request to the input."""
    return self.to_base_model(TextImageConditionalGenerationInput)

TextImageConditionalGenerationResponse

Bases: BaseResponse

Response for text-image conditional generation.

Attributes:

Name Type Description
data TextImageConditionalGenerationOutput

Output of the generation.

UsageConditionalGeneration

Bases: BaseModel

Usage metadata of the model for text-image conditional generation.

Attributes:

Name Type Description
prompt_tokens int

Number of tokens in the prompt.

completion_tokens int

Number of tokens in the completion.

total_tokens int

Total number of tokens.