File size: 2,141 Bytes
528f8f7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
operators:
- id: load_hf_package
  config:
    type: hf_source
    dataset: OpenCoder-LLM/opc-sft-stage2
    split: train
    subset: package_instruct
    trust_remote_code: True
- id: load_hf_infinity
  config:
    type: hf_source
    dataset: OpenCoder-LLM/opc-sft-stage1
    split: train
    subset: filtered_infinity_instruct
    trust_remote_code: True
- id: load_hf_largescale
  config:
    type: hf_source
    dataset: OpenCoder-LLM/opc-sft-stage1
    split: train
    subset: largescale_diverse_instruct
    trust_remote_code: True
- id: load_hf_realuser
  config:
    type: hf_source
    dataset: OpenCoder-LLM/opc-sft-stage1
    split: train
    subset: realuser_instruct
    trust_remote_code: True
- id: drop_columns
  config:
    type: function
    function: data_strategies.commons.remove_columns
    function_config:
      columns:    
        - tag
  input_ids:
  - load_hf_package
  - load_hf_realuser
  - load_hf_largescale
  - load_hf_infinity
- id: rename_task_column
  config:
    type: function
    function: data_strategies.commons.force_rename_columns
    function_config:
      column_maps:
        output: response_seed
        instruction: instruction_seed
  input_ids:
    - drop_columns
- id: sample_dataset
  config:
    type: function
    function: data_strategies.commons.uniform_sample_limited
    function_config:
      num_samples: 1_000_000  # 1.25% of 10000 target from stage 1
  input_ids:
  - rename_task_column
- id: classify
  config:
    type: fasttext
    num_cpus: 32
    hf_repo_id: mlfoundations-dev/instruction_filtering_fast_text_code_pos_leetcode_taco_neg_reflection_octopack
    input_column: instruction_seed
    target_label: "__label__QA_doc"
    top_percentage_ranking: 10
  input_ids:
   - sample_dataset
- id: keep_only
  config:
    type: function
    function: data_strategies.commons.keep_only_columns
    function_config:
      columns_to_keep:    
        - instruction_seed
  input_ids:
  - classify
- id: _add_source
  config:
    type: function
    function: data_strategies.commons.add_constant_columns
    function_config:
      source: "opencoder"
  input_ids:
  - keep_only