Views
No views yet
0.16.0.dev01base_model: google/gemma-4-31B-it
2
3load_in_8bit: false
4load_in_4bit: false
5
6plugins:
7 - axolotl.integrations.cut_cross_entropy.CutCrossEntropyPlugin
8 - axolotl.integrations.liger.LigerPlugin
9torch_compile: false
10liger_layer_norm: true
11liger_rope: true
12liger_rms_norm: true
13liger_glu_activation: true
14liger_rms_norm_gated: true
15strict: false
16
17sequence_len: 2048
18max_sample_length: 2048
19
20flash_attention: false
21sdp_attention: true
22
23sample_packing: true
24gradient_checkpointing: true
25activation_offloading: true
26
27bf16: true
28tf32: true
29
30lora_mlp_kernel: false
31lora_qkv_kernel: false
32lora_o_kernel: false
33
34datasets:
35
36 - path: ConicCat/Mura_Books
37 type: chat_template
38
39chat_template_jinja: >
40 {%- macro strip_thinking(text) -%}
41 {%- set ns = namespace(result='') -%}
42 {%- for part in text.split('<channel|>') -%}
43 {%- if '<|channel>' in part -%}
44 {%- set ns.result = ns.result + part.split('<|channel>')[0] -%}
45 {%- else -%}
46 {%- set ns.result = ns.result + part -%}
47 {%- endif -%}
48 {%- endfor -%}
49 {{- ns.result | trim -}}
50 {%- endmacro -%}
51
52 {%- set loop_messages = messages -%}
53 {{ bos_token }}
54
55 {#- Handle System Definitions Block -#}
56 {%- if (enable_thinking is defined and enable_thinking) or messages[0]['role'] in ['system', 'developer'] -%}
57 {{- '<|turn>system\n' -}}
58
59 {#- Inject Thinking token at the very top of the FIRST system turn -#}
60 {%- if enable_thinking is defined and enable_thinking -%}
61 {{- '<|think|>' -}}
62 {%- endif -%}
63
64 {%- if messages[0]['role'] in ['system', 'developer'] -%}
65 {{- messages[0]['content'] | trim -}}
66 {%- set loop_messages = messages[1:] -%}
67 {%- endif -%}
68
69 {{- '<turn|>\n' -}}
70 {%- endif %}
71
72 {#- Loop through messages -#}
73 {%- for message in loop_messages -%}
74 {%- set role = 'model' if message['role'] == 'assistant' else message['role'] -%}
75 {{- '<|turn>' + role + '\n' -}}
76
77 {#- Flag to identify the final SFT turn -#}
78 {%- set is_final_sft_turn = loop.last and not add_generation_prompt -%}
79
80 {%- if message['content'] is string -%}
81 {%- if role == 'model' -%}
82 {%- if is_final_sft_turn and '<|channel>thought' not in message['content'] -%}
83 {{- '<|channel>thought\n<channel|>' -}}
84 {%- endif -%}
85 {{- strip_thinking(message['content']) -}}
86 {%- else -%}
87 {{- message['content'] | trim -}}
88 {%- endif -%}
89 {%- elif message['content'] is sequence -%}
90 {%- set ns = namespace(has_thinking=false) -%}
91 {%- for item in message['content'] -%}
92 {%- if item['type'] == 'text' and '<|channel>thought' in item['text'] -%}
93 {%- set ns.has_thinking = true -%}
94 {%- endif -%}
95 {%- endfor -%}
96
97 {%- if role == 'model' and is_final_sft_turn and not ns.has_thinking -%}
98 {{- '<|channel>thought\n<channel|>' -}}
99 {%- endif -%}
100
101 {%- for item in message['content'] -%}
102 {%- if item['type'] == 'text' -%}
103 {%- if role == 'model' -%}
104 {{- strip_thinking(item['text']) -}}
105 {%- else -%}
106 {{- item['text'] | trim -}}
107 {%- endif -%}
108 {%- endif -%}
109 {%- endfor -%}
110 {%- endif -%}
111
112 {{- '<turn|>\n' -}}
113 {%- endfor -%}
114
115 {#- Generation Prompt handled as normal (serves as the final turn when true) -#}
116 {%- if add_generation_prompt -%}
117 {{- '<|turn>model\n' -}}
118 {%- if not enable_thinking | default(false) -%}
119 {{- '<|channel>thought\n<channel|>' -}}
120 {%- endif -%}
121 {%- endif -%}
122
123
124adapter: lora
125lora_r: 32
126lora_alpha: 64
127lora_dropout: 0.0
128lora_bias: None
129lora_target_modules: 'model.language_model.layers.[\d]+.(_checkpoint_wrapped_module.)?(mlp|self_attn).(up|down|gate|q|k|v|o)_proj'
130use_tensorboard: true
131
132optimizer: paged_adamw_8bit
133learning_rate: 2.5e-5 # 1e-4 / 4
134loraplus_lr_ratio: 16
135
136# Training arguments
137output_dir: ./Writer-Stage-2
138num_epochs: 11
139micro_batch_size: 2
140gradient_accumulation_steps: 4
141save_strategy: 'no'
142warmup_ratio: 0.05
143lr_scheduler: 'cosine'
144max_grad_norm: 1
145logging_steps: 1
146seed: 42
147
148eot_tokens:
149 - "<turn|>"
150
151push_dataset_to_hub: ConicCat/Gemma4-Mura
152hf_use_auth_token: true