Automatic dcft datacuration framework upload for oh_v1.3_camel_math_x2
Browse files
config/Alpaca/alpaca_gpt-4o-mini.yaml
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
operators:
|
| 2 |
+
- id: load_seed_instructions
|
| 3 |
+
config:
|
| 4 |
+
type: function
|
| 5 |
+
function: data_strategies.Alpaca.utils.load_seed_instructions
|
| 6 |
+
function_config:
|
| 7 |
+
seed_tasks_path: dcft/data_strategies/Alpaca/resources/seed_tasks.jsonl
|
| 8 |
+
|
| 9 |
+
# NOTE(Ryan): Here we have to guess the number of instructions to generate based on the yeild over time of filtering out samples downstream.
|
| 10 |
+
- id: create_alpaca_prompts
|
| 11 |
+
config:
|
| 12 |
+
type: function
|
| 13 |
+
function: data_strategies.Alpaca.utils.create_alpaca_prompts
|
| 14 |
+
function_config:
|
| 15 |
+
num_instructions_to_generate: 1_000_000
|
| 16 |
+
num_prompt_instructions: 3
|
| 17 |
+
output_column: alpaca_prompt
|
| 18 |
+
input_ids:
|
| 19 |
+
- load_seed_instructions
|
| 20 |
+
|
| 21 |
+
- id: generate_instruction_input_output_tuples
|
| 22 |
+
config:
|
| 23 |
+
type: completions
|
| 24 |
+
map: alpaca
|
| 25 |
+
map_config:
|
| 26 |
+
alpaca_prompt_column: alpaca_prompt
|
| 27 |
+
num_seed_instructions: 3 # NOTE(Ryan) used for Alpaca's parsing code, needs to match the number in the previous step
|
| 28 |
+
output_instruction_column: instruction
|
| 29 |
+
output_input_column: input
|
| 30 |
+
output_output_column: output
|
| 31 |
+
model: gpt-4o-mini
|
| 32 |
+
batch: False
|
| 33 |
+
input_ids:
|
| 34 |
+
- create_alpaca_prompts
|
| 35 |
+
|
| 36 |
+
- id: filter_instructions_by_heuristics
|
| 37 |
+
config:
|
| 38 |
+
type: function
|
| 39 |
+
function: data_strategies.Alpaca.utils.instructions_heuristics
|
| 40 |
+
function_config:
|
| 41 |
+
input_instruction_column: instruction
|
| 42 |
+
output_filtered_reason_column: filtered_reason
|
| 43 |
+
output_filtered_decision_column: filtered_decision
|
| 44 |
+
input_ids:
|
| 45 |
+
- generate_instruction_input_output_tuples
|
| 46 |
+
|
| 47 |
+
- id: remove_filtered_instructions
|
| 48 |
+
config:
|
| 49 |
+
type: function
|
| 50 |
+
function: data_strategies.commons.filter_out_truey_values
|
| 51 |
+
function_config:
|
| 52 |
+
filter_column: filtered_decision
|
| 53 |
+
input_ids:
|
| 54 |
+
- filter_instructions_by_heuristics
|
| 55 |
+
|
| 56 |
+
# NOTE(Ryan): This is a departure from the original Alpaca recipe which uses ROUGE and 0.7 threshold, we do this to compute similarity scores faster.
|
| 57 |
+
# NOTE(Ryan): We also do not include the seed instructions here, we only check the similarity of the generated instructions against each other.
|
| 58 |
+
- id: filter_instructions_cosine_similarity
|
| 59 |
+
config:
|
| 60 |
+
type: function
|
| 61 |
+
function: data_strategies.Alpaca.utils.filter_instructions_cosine_similarity
|
| 62 |
+
function_config:
|
| 63 |
+
similarity_threshold: 0.9
|
| 64 |
+
input_instruction_column: instruction
|
| 65 |
+
input_ids:
|
| 66 |
+
- remove_filtered_instructions
|
| 67 |
+
|
| 68 |
+
- id: convert_alpaca_to_sharegpt
|
| 69 |
+
config:
|
| 70 |
+
type: function
|
| 71 |
+
function: data_strategies.commons.convert_alpaca_to_sharegpt
|
| 72 |
+
function_config:
|
| 73 |
+
input_instruction_column: instruction
|
| 74 |
+
input_input_column: input
|
| 75 |
+
input_output_column: output
|
| 76 |
+
output_sharegpt_column: conversations
|
| 77 |
+
input_ids:
|
| 78 |
+
- filter_instructions_cosine_similarity
|