Text generation
TextGenerationToArgilla
¶
Bases: Argilla
Step that creates a dataset in Argilla during the load phase, and then pushes the input batches into it as records. This dataset is a text-generation dataset, where there's one field per each input, and then a label question to rate the quality of the completion in either bad (represented with 👎) or good (represented with 👍).
Note
This step is meant to be used in conjunction with a TextGeneration
step and no column mapping
is needed, as it will use the default values for the instruction
and generation
columns.
Attributes:
Name | Type | Description |
---|---|---|
dataset_name |
The name of the dataset in Argilla. |
|
dataset_workspace |
The workspace where the dataset will be created in Argilla. Defaults to
|
|
api_url |
The URL of the Argilla API. Defaults to |
|
api_key |
The API key to authenticate with Argilla. Defaults to |
Runtime parameters
api_url
: The base URL to use for the Argilla API requests.api_key
: The API key to authenticate the requests to the Argilla API.
Input columns
- instruction (
str
): The instruction that was used to generate the completion. - generation (
str
orList[str]
): The completions that were generated based on the input instruction.
Source code in src/distilabel/steps/argilla/text_generation.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
|
inputs: List[str]
property
¶
The inputs for the step are the instruction
and the generation
.
load()
¶
Sets the _instruction
and _generation
attributes based on the inputs_mapping
, otherwise
uses the default values; and then uses those values to create a FeedbackDataset
suited for
the text-generation scenario. And then it pushes it to Argilla.
Source code in src/distilabel/steps/argilla/text_generation.py
process(inputs)
¶
Creates and pushes the records as FeedbackRecords to the Argilla dataset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
inputs |
StepInput
|
A list of Python dictionaries with the inputs of the task. |
required |
Returns:
Type | Description |
---|---|
StepOutput
|
A list of Python dictionaries with the outputs of the task. |