ImageTask¶
This section contains the API reference for the distilabel
image generation tasks.
For more information on how the ImageTask
works and see some examples, check the Tutorial - Task - ImageTask page.
ImageTask
¶
ImageTask
is a class that implements the _Task
abstract class and adds the Step
interface to be used as a step in the pipeline. It differs from the Task
in that it's
expected to work with ImageGenerationModel
s instead of LLM
s.
Attributes:
Name | Type | Description |
---|---|---|
image_generation_model |
ImageGenerationModel
|
the |
llm |
Union[LLM, ImageGenerationModel, None]
|
This attribute is here to respect the |
group_generations |
bool
|
whether to group the |
num_generations |
RuntimeParameter[int]
|
The number of generations to be produced per input. |
Source code in src/distilabel/steps/tasks/base.py
499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 |
|
format_input(input)
abstractmethod
¶
Abstract method to format the inputs of the task. It needs to receive an input as a Python dictionary, and generates a string to be used as the prompt for the model.
Source code in src/distilabel/steps/tasks/base.py
process(inputs)
abstractmethod
¶
Processes the inputs of the task and generates the outputs using the ImageGenerationModel
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
inputs
|
StepInput
|
A list of Python dictionaries with the inputs of the task. |
required |
Yields:
Type | Description |
---|---|
StepOutput
|
A list of Python dictionaries with the outputs of the task. |