File size: 13,113 Bytes
a7a3ab3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
distilabel:
  version: 1.4.1
pipeline:
  name: pipeline-translate-demo
  description: Pipeline translate demo
  steps:
  - step:
      name: load_dataset
      resources:
        replicas: 1
        cpus: null
        gpus: null
        memory: null
        resources: null
      input_mappings: {}
      output_mappings: {}
      use_cache: true
      batch_size: 50
      repo_id: mteb/emotion
      split: train
      config: null
      revision: null
      streaming: false
      num_examples: null
      storage_options: null
      runtime_parameters_info:
      - name: resources
        runtime_parameters_info:
        - name: replicas
          optional: true
          description: The number of replicas for the step.
        - name: cpus
          optional: true
          description: The number of CPUs assigned to each step replica.
        - name: gpus
          optional: true
          description: The number of GPUs assigned to each step replica.
        - name: memory
          optional: true
          description: The memory in bytes required for each step replica.
        - name: resources
          optional: true
          description: A dictionary containing names of custom resources and the number
            of those resources required for each step replica.
      - name: batch_size
        optional: true
        description: The number of rows that will contain the batches generated by
          the step.
      - name: repo_id
        optional: false
        description: The Hugging Face Hub repository ID of the dataset to load.
      - name: split
        optional: true
        description: The split of the dataset to load. Defaults to 'train'.
      - name: config
        optional: true
        description: The configuration of the dataset to load. This is optional and
          only needed if the dataset has multiple configurations.
      - name: revision
        optional: true
        description: The revision of the dataset to load. Defaults to the latest revision.
      - name: streaming
        optional: true
        description: Whether to load the dataset in streaming mode or not. Defaults
          to False.
      - name: num_examples
        optional: true
        description: The number of examples to load from the dataset. By default will
          load all examples.
      type_info:
        module: distilabel.steps.generators.huggingface
        name: LoadDataFromHub
    name: load_dataset
  - step:
      name: translate_en2vi_demo
      resources:
        replicas: 1
        cpus: null
        gpus: 2
        memory: null
        resources: null
      input_mappings: {}
      output_mappings: {}
      use_cache: true
      input_batch_size: 50
      llm:
        cuda_devices: auto
        disable_cuda_device_placement: false
        use_magpie_template: false
        magpie_pre_query_template: null
        generation_kwargs:
          temperature: 0.0
          top_p: 1.0
          max_new_tokens: 4096
        use_offline_batch_generation: false
        offline_batch_generation_block_until_done: null
        jobs_ids: null
        model: CohereForAI/aya-23-35B
        dtype: bfloat16
        trust_remote_code: false
        quantization: null
        revision: null
        tokenizer: CohereForAI/aya-23-35B
        tokenizer_mode: auto
        tokenizer_revision: null
        skip_tokenizer_init: false
        chat_template: null
        seed: 0
        extra_kwargs:
          tensor_parallel_size: 2
          distributed_executor_backend: ray
          gpu_memory_utilization: 0.9
          max_model_len: 4096
        structured_output: null
        type_info:
          module: distilabel.llms.vllm
          name: vLLM
      group_generations: false
      add_raw_output: true
      add_raw_input: true
      num_generations: 1
      use_default_structured_output: false
      system_prompt: You are a professional translator with a deep understanding of
        both the English and Vietnamese languages. You possess a high level of proficiency
        in translating between these languages, ensuring that the translation retains
        both the meaning and cultural nuances of the original text. With a thorough
        knowledge of grammar, syntax, and colloquialisms in both languages, you can
        accurately and naturally translate the following from English to Vietnamese
        while maintaining its intended tone and context. Your work is known for its
        precision and attention to detail, making your translations clear and effective
        for a wide audience.
      use_system_prompt: false
      template: 'Translate the following from English to Vietnamese:


        {{text}}


        TRANSLATED VERSION IN VIETNAMESE IS:

        '
      columns:
      - text
      runtime_parameters_info:
      - name: resources
        runtime_parameters_info:
        - name: replicas
          optional: true
          description: The number of replicas for the step.
        - name: cpus
          optional: true
          description: The number of CPUs assigned to each step replica.
        - name: gpus
          optional: true
          description: The number of GPUs assigned to each step replica.
        - name: memory
          optional: true
          description: The memory in bytes required for each step replica.
        - name: resources
          optional: true
          description: A dictionary containing names of custom resources and the number
            of those resources required for each step replica.
      - name: input_batch_size
        optional: true
        description: The number of rows that will contain the batches processed by
          the step.
      - name: llm
        runtime_parameters_info:
        - name: cuda_devices
          optional: true
          description: A list with the ID of the CUDA devices to be used.
        - name: disable_cuda_device_placement
          optional: true
          description: Whether to disable the CUDA device placement logic or not.
        - name: generation_kwargs
          description: The kwargs to be propagated to either `generate` or `agenerate`
            methods within each `LLM`.
          keys:
          - name: max_new_tokens
            optional: true
            description: the maximum number of new tokens that the model will generate.  Defaults
              to `128`.
          - name: presence_penalty
            optional: true
            description: the presence penalty to use for the generation. Defaults
              to  `0.0`.
          - name: frequency_penalty
            optional: true
            description: the repetition penalty to use for the generation. Defaults  to
              `0.0`.
          - name: repetition_penalty
            optional: true
            description: the repetition penalty to use for the generation Defaults
              to  `1.0`.
          - name: temperature
            optional: true
            description: the temperature to use for the generation. Defaults to `0.1`.
          - name: top_p
            optional: true
            description: the top-p value to use for the generation. Defaults to `1.0`.
          - name: top_k
            optional: true
            description: the top-k value to use for the generation. Defaults to `0`.
          - name: min_p
            optional: true
            description: the minimum probability to use for the generation. Defaults
              to `0.0`.
          - name: stop
            optional: true
            description: a list of strings that will be used to stop the generation
              when found.  Defaults to `None`.
          - name: stop_token_ids
            optional: true
            description: a list of token ids that will be used to stop the generation  when
              found. Defaults to `None`.
          - name: include_stop_str_in_output
            optional: true
            description: whether to include the stop string in the output.  Defaults
              to `False`.
          - name: logits_processors
            optional: true
            description: a list of functions to process the logits before sampling.  Defaults
              to `None`.
          - name: extra_sampling_params
            optional: true
            description: dictionary with additional arguments to be passed to  the
              `SamplingParams` class from `vllm`.
        - name: use_offline_batch_generation
          optional: true
          description: Whether to use the `offline_batch_generate` method to generate
            the responses.
        - name: offline_batch_generation_block_until_done
          optional: true
          description: If provided, then polling will be done until the `ofline_batch_generate`
            method is able to retrieve the results. The value indicate the time to
            wait between each polling.
        - name: extra_kwargs
          optional: true
          description: 'Additional dictionary of keyword arguments that will be passed
            to the `vLLM` class of `vllm` library. See all the supported arguments
            at: https://github.com/vllm-project/vllm/blob/main/vllm/entrypoints/llm.py'
        - name: structured_output
          optional: true
          description: The structured output format to use across all the generations.
      - name: add_raw_output
        optional: true
        description: Whether to include the raw output of the LLM in the key `raw_output_<TASK_NAME>`
          of the `distilabel_metadata` dictionary output column
      - name: add_raw_input
        optional: true
        description: Whether to include the raw input of the LLM in the key `raw_input_<TASK_NAME>`
          of the `distilabel_metadata` dictionary column
      - name: num_generations
        optional: true
        description: The number of generations to be produced per input.
      type_info:
        module: __main__
        name: TranslateText
    name: translate_en2vi_demo
  - step:
      name: rename_columns
      resources:
        replicas: 1
        cpus: null
        gpus: null
        memory: null
        resources: null
      input_mappings: {}
      output_mappings: {}
      use_cache: true
      input_batch_size: 50
      columns_map:
        text: og_text
        label: label
        label_text: label_text
        vietnamese_version: text
      runtime_parameters_info:
      - name: resources
        runtime_parameters_info:
        - name: replicas
          optional: true
          description: The number of replicas for the step.
        - name: cpus
          optional: true
          description: The number of CPUs assigned to each step replica.
        - name: gpus
          optional: true
          description: The number of GPUs assigned to each step replica.
        - name: memory
          optional: true
          description: The memory in bytes required for each step replica.
        - name: resources
          optional: true
          description: A dictionary containing names of custom resources and the number
            of those resources required for each step replica.
      - name: input_batch_size
        optional: true
        description: The number of rows that will contain the batches processed by
          the step.
      type_info:
        module: __main__
        name: RenameColumns
    name: rename_columns
  - step:
      name: keep_columns
      resources:
        replicas: 1
        cpus: null
        gpus: null
        memory: null
        resources: null
      input_mappings: {}
      output_mappings: {}
      use_cache: true
      input_batch_size: 50
      columns:
      - text
      - label
      - label_text
      - og_text
      runtime_parameters_info:
      - name: resources
        runtime_parameters_info:
        - name: replicas
          optional: true
          description: The number of replicas for the step.
        - name: cpus
          optional: true
          description: The number of CPUs assigned to each step replica.
        - name: gpus
          optional: true
          description: The number of GPUs assigned to each step replica.
        - name: memory
          optional: true
          description: The memory in bytes required for each step replica.
        - name: resources
          optional: true
          description: A dictionary containing names of custom resources and the number
            of those resources required for each step replica.
      - name: input_batch_size
        optional: true
        description: The number of rows that will contain the batches processed by
          the step.
      type_info:
        module: distilabel.steps.columns.keep
        name: KeepColumns
    name: keep_columns
  connections:
  - from: load_dataset
    to:
    - translate_en2vi_demo
  - from: translate_en2vi_demo
    to:
    - rename_columns
  - from: rename_columns
    to:
    - keep_columns
  - from: keep_columns
    to: []
  routing_batch_functions: []
  type_info:
    module: distilabel.pipeline.local
    name: Pipeline
requirements: []