Views
No views yet
0.6.01# git clone https://github.com/axolotl-ai-cloud/axolotl
2# cd axolotl
3# git checkout 844331005c1ef45430ff26b9f42f757dce6ee66a
4# pip3 install packaging ninja huggingface_hub[cli]
5# pip3 install -e '.[flash-attn,deepspeed]'
6# huggingface-cli login --token $hf_key && wandb login $wandb_key
7# python -m axolotl.cli.preprocess nemo-rp-test-2.yml
8# accelerate launch -m axolotl.cli.train nemo-rp-test-2.yml
9# python -m axolotl.cli.merge_lora nemo-rp-test.yml
10# huggingface-cli upload Columbidae/nemo-rp-test train-workspace/merged . --exclude "*.md"
11
12# git clone https://github.com/axolotl-ai-cloud/axolotl && cd axolotl && pip3 install packaging ninja huggingface_hub[cli] && pip3 install -e '.[flash-attn,deepspeed]' && cd .. && huggingface-cli login --token $hf_key && wandb login $wandb_key
13
14# Model
15base_model: unsloth/Mistral-Small-Instruct-2409
16model_type: AutoModelForCausalLM
17tokenizer_type: AutoTokenizer
18
19load_in_8bit: false
20load_in_4bit: true
21strict: false
22bf16: true
23fp16:
24tf32: false
25flash_attention: true
26special_tokens:
27
28# Output
29output_dir: ./train-workspace
30hub_model_id: ToastyPigeon/ms-rp-test-ws
31hub_strategy: "all_checkpoints"
32resume_from_checkpoint:
33saves_per_epoch: 5
34
35# Data
36sequence_len: 16384 # fits
37min_sample_len: 128
38dataset_prepared_path: last_run_prepared
39datasets:
40 - path: ToastyPigeon/some-rp
41 type: chat_template
42 field_messages: conversations
43 message_field_role: from
44 message_field_content: value
45train_on_inputs: true
46warmup_steps: 20
47shuffle_merged_datasets: true
48sample_packing: true
49pad_to_sequence_len: true
50chat_template: jinja
51chat_template_jinja: "{%- if messages[0][\"role\"] == \"fake\" %}\n {%- set system_message = messages[0][\"content\"] %}\n {%- set loop_messages = messages[1:] %}\n{%- else %}\n {%- set loop_messages = messages %}\n{%- endif %}\n{%- if not tools is defined %}\n {%- set tools = none %}\n{%- endif %}\n{%- set user_messages = loop_messages | selectattr(\"role\", \"equalto\", \"user\") | list %}\n\n{{- bos_token }}\n{%- for message in loop_messages %}\n {%- if message[\"role\"] == \"user\" or message[\"role\"] == \"system\"%}\n {%- if tools is not none and (message == user_messages[-1]) %}\n {{- \"[AVAILABLE_TOOLS][\" }}\n {%- for tool in tools %}\n {%- set tool = tool.function %}\n {{- '{\"type\": \"function\", \"function\": {' }}\n {%- for key, val in tool.items() if key != \"return\" %}\n {%- if val is string %}\n {{- '\"' + key + '\": \"' + val + '\"' }}\n {%- else %}\n {{- '\"' + key + '\": ' + val|tojson }}\n {%- endif %}\n {%- if not loop.last %}\n {{- \", \" }}\n {%- endif %}\n {%- endfor %}\n {{- \"}}\" }}\n {%- if not loop.last %}\n {{- \", \" }}\n {%- else %}\n {{- \"]\" }}\n {%- endif %}\n {%- endfor %}\n {{- \"[/AVAILABLE_TOOLS]\" }}\n {%- endif %}\n {%- if loop.last and system_message is defined %}\n {{- \"[INST] \" + system_message + \"\\n\\n\" + message[\"content\"] + \"[/INST] \" }}\n {%- else %}\n {{- \"[INST] \" + message[\"content\"] + \"[/INST] \" }}\n {%- endif %}\n {%- elif (message.tool_calls is defined and message.tool_calls is not none) %}\n {{- \"[TOOL_CALLS][\" }}\n {%- for tool_call in message.tool_calls %}\n {%- set out = tool_call.function|tojson %}\n {{- out[:-1] }}\n {%- if not tool_call.id is defined or tool_call.id|length != 9 %}\n {{- raise_exception(\"Tool call IDs should be alphanumeric strings with length 9!\") }}\n {%- endif %}\n {{- ', \"id\": \"' + tool_call.id + '\"}' }}\n {%- if not loop.last %}\n {{- \", \" }}\n {%- else %}\n {{- \"]\" + eos_token }}\n {%- endif %}\n {%- endfor %}\n {%- elif message[\"role\"] == \"assistant\" %}\n {{- message[\"content\"] + eos_token}}\n {%- elif message[\"role\"] == \"tool_results\" or message[\"role\"] == \"tool\" %}\n {%- if message.content is defined and message.content.content is defined %}\n {%- set content = message.content.content %}\n {%- else %}\n {%- set content = message.content %}\n {%- endif %}\n {{- '[TOOL_RESULTS]{\"content\": ' + content|string + \", \" }}\n {%- if not message.tool_call_id is defined or message.tool_call_id|length != 9 %}\n {{- raise_exception(\"Tool call IDs should be alphanumeric strings with length 9!\") }}\n {%- endif %}\n {{- '\"call_id\": \"' + message.tool_call_id + '\"}[/TOOL_RESULTS]' }}\n {%- else %}\n {{- raise_exception(\"Only user and assistant roles are supported, with the exception of an initial optional system message!\") }}\n {%- endif %}\n{%- endfor %}\n"
52
53# Batching
54num_epochs: 1
55gradient_accumulation_steps: 1
56micro_batch_size: 1
57eval_batch_size: 1
58
59# Evaluation
60val_set_size: 50
61evals_per_epoch: 10
62eval_table_size:
63eval_max_new_tokens: 256
64eval_sample_packing: false
65
66save_safetensors: true
67
68# WandB
69wandb_project: Nemo-Rp-Test
70#wandb_entity:
71
72gradient_checkpointing: 'unsloth'
73gradient_checkpointing_kwargs:
74 use_reentrant: false
75
76unsloth_cross_entropy_loss: true
77#unsloth_lora_mlp: true
78#unsloth_lora_qkv: true
79#unsloth_lora_o: true
80
81# LoRA
82adapter: qlora
83lora_model_dir:
84lora_r: 32
85lora_alpha: 64
86lora_dropout: 0.25
87lora_target_linear:
88lora_fan_in_fan_out:
89lora_target_modules:
90 - gate_proj
91 - down_proj
92 - up_proj
93 - q_proj
94 - v_proj
95 - k_proj
96 - o_proj
97lora_modules_to_save:
98
99# Optimizer
100optimizer: paged_ademamix_8bit # adamw_8bit
101lr_scheduler: cosine
102learning_rate: 5e-5
103cosine_min_lr_ratio: 0.1
104weight_decay: 0.01
105max_grad_norm: 1.0
106
107# Misc
108#train_on_inputs: false
109group_by_length: false
110early_stopping_patience:
111local_rank:
112logging_steps: 1
113xformers_attention:
114debug:
115deepspeed: /workspace/axolotl/deepspeed_configs/zero3_bf16.json # previously blank
116fsdp:
117fsdp_config:
118
119plugins:
120 - axolotl.integrations.liger.LigerPlugin
121liger_rope: true
122liger_rms_norm: true
123liger_layer_norm: true
124liger_glu_activation: true
125liger_fused_linear_cross_entropy: true
126
127gc_steps: 10
128seed: 69| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 2.1185 | 0.0034 | 1 | 2.0953 |
| 2.055 | 0.1014 | 30 | 2.0229 |
| 2.1407 | 0.2027 | 60 | 2.0158 |
| 2.0997 | 0.3041 | 90 | 2.0111 |
| 2.1113 | 0.4054 | 120 | 2.0099 |
| 2.1695 | 0.5068 | 150 | 2.0076 |
| 2.0782 | 0.6081 | 180 | 2.0063 |
| 2.0972 | 0.7095 | 210 | 2.0054 |
| 2.1761 | 0.8108 | 240 | 2.0043 |
| 2.1288 | 0.9122 | 270 | 2.0036 |