File size: 3,515 Bytes
81be976
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
operators:
- id: load_hf_python
  config:
    type: hf_source
    dataset: bigcode/commitpackft
    split: train
    subset: python
    trust_remote_code: True
- id: load_hf_c++
  config:
    type: hf_source
    dataset: bigcode/commitpackft
    split: train
    subset: c++
    trust_remote_code: True
- id: load_hf_java
  config:
    type: hf_source
    dataset: bigcode/commitpackft
    split: train
    subset: java
    trust_remote_code: True
- id: load_hf_c
  config:
    trust_remote_code: True
    type: hf_source
    dataset: bigcode/commitpackft
    split: train
    subset: c
- id: load_hf_c#
  config:
    trust_remote_code: True
    type: hf_source
    dataset: bigcode/commitpackft
    split: train
    subset: c#
- id: load_hf_css
  config:
    trust_remote_code: True
    type: hf_source
    dataset: bigcode/commitpackft
    split: train
    subset: css
- id: load_hf_javascript
  config:
    trust_remote_code: True
    type: hf_source
    dataset: bigcode/commitpackft
    split: train
    subset: javascript
- id: load_hf_ruby
  config:
    trust_remote_code: True
    type: hf_source
    dataset: bigcode/commitpackft
    split: train
    subset: ruby
- id: load_hf_shell
  config:
    trust_remote_code: True
    type: hf_source
    dataset: bigcode/commitpackft
    split: train
    subset: shell
- id: mix_operator
  config:
    type: mix
  input_ids:
  - load_hf_python
  - load_hf_shell
  - load_hf_c++
  - load_hf_java
  - load_hf_c
  - load_hf_c#
  - load_hf_css
  - load_hf_javascript
  - load_hf_ruby
- id: sample_dataset
  config:
    type: function
    function: data_strategies.commons.uniform_sample_limited
    function_config:
      num_samples: 50000  # 1.25% of 10000 target from stage 1
  input_ids:
    - mix_operator
- id: generate_instructions
  config:
    type: completions
    map: chat
    map_config:
      system_message: "You are a helpful assistant."
      user_message: |
        You are to generate a question or task for a language model based on the following instruction and code pairs. 

        Instruction: {{message}}
        Code: {{old_contents}}
        
        Include only the new question and task. Do not include anything like "Here is the instruction". Include
        the code in your question and make the task sound like what a human would ask a language model. 
      output_column: instruction_seed
    model: gpt-4o-mini
    temperature: 1.0
    batch: True
  input_ids:
    - sample_dataset
- id: add_constant_column
  config:
    type: function
    function: data_strategies.commons.add_constant_columns
    function_config:
      response_seed: ""
  input_ids:
  - generate_instructions
- id: rename_task_column
  config:
    type: function
    function: data_strategies.commons.keep_only_columns
    function_config:
      columns_to_keep:
      - response_seed
      - instruction_seed
  input_ids:
  - add_constant_column
- id: annotate
  config:
    type: completions
    map: chat
    map_config:
      system_message: "You are a helpful assistant."
      user_message_column: instruction_seed
      output_column: response
    model: gpt-4o-mini
    temperature: 1.0
    batch: True
  input_ids:
  - rename_task_column
- id: convert_to_sharegpt
  config:
    type: function
    function: data_strategies.commons.convert_instruction_response_to_sharegpt
    function_config:
      input_instruction_column: instruction_seed
      input_response_column: response
      output_sharegpt_column: conversations
  input_ids:
    - annotate