lucyknada commited on
Commit
2d28e01
1 Parent(s): e9a242b

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +235 -0
README.md ADDED
@@ -0,0 +1,235 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: gemma
3
+ language:
4
+ - en
5
+ tags:
6
+ - chat
7
+ pipeline_tag: text-generation
8
+ library_name: transformers
9
+ ---
10
+
11
+ ## This repo contains EXL2 quants of the model. If you need the original weights, please find them [here](https://huggingface.co/anthracite-org/magnum-v4-27b).
12
+ ## Base repo only contains the measurement file, see revisions for your quant of choice.
13
+
14
+ - [measurement.json](https://huggingface.co/anthracite-org/magnum-v4-27b-exl2/tree/main)
15
+ - [3.0bpw](https://huggingface.co/anthracite-org/magnum-v4-27b-exl2/tree/3.0bpw)
16
+ - [4.0bpw](https://huggingface.co/anthracite-org/magnum-v4-27b-exl2/tree/4.0bpw)
17
+ - [5.0bpw](https://huggingface.co/anthracite-org/magnum-v4-27b-exl2/tree/5.0bpw)
18
+ - [6.0bpw](https://huggingface.co/anthracite-org/magnum-v4-27b-exl2/tree/6.0bpw)
19
+ - [8.0bpw](https://huggingface.co/anthracite-org/magnum-v4-27b-exl2/tree/8.0bpw)
20
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/658a46cbfb9c2bdfae75b3a6/EAyOLldRzMpRwdsUZ5PLl.png)
21
+ ## This repo contains GGUF quants of the model. If you need the original weights, please find them [here](https://huggingface.co/anthracite-org/magnum-v4-27b).
22
+
23
+ This is a series of models designed to replicate the prose quality of the Claude 3 models, specifically Sonnet and Opus.
24
+
25
+
26
+
27
+ This model is fine-tuned on top of [Gemma 27b (chatML'ified)](https://huggingface.co/IntervitensInc/gemma-2-27b-chatml).
28
+
29
+ ## Prompting
30
+ A typical input would look like this:
31
+
32
+ ```py
33
+ <|im_start|>system
34
+ system prompt<|im_end|>
35
+ <|im_start|>user
36
+ Hi there!<|im_end|>
37
+ <|im_start|>assistant
38
+ Nice to meet you!<|im_end|>
39
+ <|im_start|>user
40
+ Can I ask a question?<|im_end|>
41
+ <|im_start|>assistant
42
+ ```
43
+
44
+ ## SillyTavern templates
45
+
46
+ Below are Instruct and Context templates for use within SillyTavern.
47
+
48
+ <details><summary>context template</summary>
49
+
50
+ ```yaml
51
+ {
52
+ "story_string": "<|im_start|>system\n{{#if system}}{{system}}\n{{/if}}{{#if wiBefore}}{{wiBefore}}\n{{/if}}{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{char}}'s personality: {{personality}}\n{{/if}}{{#if scenario}}Scenario: {{scenario}}\n{{/if}}{{#if wiAfter}}{{wiAfter}}\n{{/if}}{{#if persona}}{{persona}}\n{{/if}}{{trim}}<|im_end|>\n",
53
+ "example_separator": "",
54
+ "chat_start": "",
55
+ "use_stop_strings": false,
56
+ "allow_jailbreak": false,
57
+ "always_force_name2": true,
58
+ "trim_sentences": false,
59
+ "include_newline": false,
60
+ "single_line": false,
61
+ "name": "Magnum ChatML"
62
+ }
63
+ ```
64
+
65
+ </details><br>
66
+ <details><summary>instruct template</summary>
67
+
68
+ ```yaml
69
+ {
70
+ "system_prompt": "Currently, your role is {{char}}, described in detail below. As {{char}}, continue the narrative exchange with {{user}}.\n\n<Guidelines>\n• Maintain the character persona but allow it to evolve with the story.\n• Be creative and proactive. Drive the story forward, introducing plotlines and events when relevant.\n• All types of outputs are encouraged; respond accordingly to the narrative.\n• Include dialogues, actions, and thoughts in each response.\n• Utilize all five senses to describe scenarios within {{char}}'s dialogue.\n• Use emotional symbols such as "!" and "~" in appropriate contexts.\n• Incorporate onomatopoeia when suitable.\n• Allow time for {{user}} to respond with their own input, respecting their agency.\n• Act as secondary characters and NPCs as needed, and remove them when appropriate.\n• When prompted for an Out of Character [OOC:] reply, answer neutrally and in plaintext, not as {{char}}.\n</Guidelines>\n\n<Forbidden>\n• Using excessive literary embellishments and purple prose unless dictated by {{char}}'s persona.\n• Writing for, speaking, thinking, acting, or replying as {{user}} in your response.\n• Repetitive and monotonous outputs.\n• Positivity bias in your replies.\n• Being overly extreme or NSFW when the narrative context is inappropriate.\n</Forbidden>\n\nFollow the instructions in <Guidelines></Guidelines>, avoiding the items listed in <Forbidden></Forbidden>.",
71
+ "input_sequence": "<|im_start|>user\n",
72
+ "output_sequence": "<|im_start|>assistant\n",
73
+ "last_output_sequence": "",
74
+ "system_sequence": "<|im_start|>system\n",
75
+ "stop_sequence": "<|im_end|>",
76
+ "wrap": false,
77
+ "macro": true,
78
+ "names": true,
79
+ "names_force_groups": true,
80
+ "activation_regex": "",
81
+ "system_sequence_prefix": "",
82
+ "system_sequence_suffix": "",
83
+ "first_output_sequence": "",
84
+ "skip_examples": false,
85
+ "output_suffix": "<|im_end|>\n",
86
+ "input_suffix": "<|im_end|>\n",
87
+ "system_suffix": "<|im_end|>\n",
88
+ "user_alignment_message": "",
89
+ "system_same_as_user": false,
90
+ "last_system_sequence": "",
91
+ "name": "Magnum ChatML"
92
+ }
93
+ ```
94
+
95
+ </details><br>
96
+
97
+ ## Axolotl config
98
+
99
+ <details><summary>See axolotl config</summary>
100
+
101
+ ```yaml
102
+ base_model: IntervitensInc/gemma-2-27b-chatml
103
+ model_type: AutoModelForCausalLM
104
+ tokenizer_type: AutoTokenizer
105
+
106
+ hub_model_id: anthracite-org/magnum-v4-27b-r1
107
+ hub_strategy: "all_checkpoints"
108
+ push_dataset_to_hub:
109
+ hf_use_auth_token: true
110
+
111
+ plugins:
112
+ - axolotl.integrations.liger.LigerPlugin
113
+ liger_cross_entropy: true
114
+ #liger_rope: true
115
+ #liger_rms_norm: true
116
+ #liger_swiglu: true
117
+ #liger_fused_linear_cross_entropy: true
118
+
119
+ load_in_8bit: false
120
+ load_in_4bit: false
121
+ strict: false
122
+
123
+ datasets:
124
+ - path: anthracite-org/c2_logs_16k_llama_v1.1
125
+ type: sharegpt
126
+ conversation: chatml
127
+ - path: NewEden/Claude-Instruct-5K
128
+ type: sharegpt
129
+ conversation: chatml
130
+ - path: anthracite-org/kalo-opus-instruct-22k-no-refusal
131
+ type: sharegpt
132
+ conversation: chatml
133
+ - path: Epiculous/SynthRP-Gens-v1.1-Filtered-n-Cleaned
134
+ type: sharegpt
135
+ conversation: chatml
136
+ - path: lodrick-the-lafted/kalo-opus-instruct-3k-filtered
137
+ type: sharegpt
138
+ conversation: chatml
139
+ - path: anthracite-org/nopm_claude_writing_fixed
140
+ type: sharegpt
141
+ conversation: chatml
142
+ - path: Epiculous/Synthstruct-Gens-v1.1-Filtered-n-Cleaned
143
+ type: sharegpt
144
+ conversation: chatml
145
+ - path: anthracite-org/kalo_opus_misc_240827
146
+ type: sharegpt
147
+ conversation: chatml
148
+ - path: anthracite-org/kalo_misc_part2
149
+ type: sharegpt
150
+ conversation: chatml
151
+ chat_template: chatml
152
+ shuffle_merged_datasets: true
153
+ default_system_message: "You are an assistant that responds to the user."
154
+ dataset_prepared_path: /workspace/data/27-fft-data
155
+ val_set_size: 0.0
156
+ output_dir: /workspace/data/27b-fft-out
157
+
158
+ sequence_len: 8192
159
+ sample_packing: true
160
+ eval_sample_packing: false
161
+ pad_to_sequence_len: true
162
+
163
+ adapter:
164
+ lora_model_dir:
165
+ lora_r:
166
+ lora_alpha:
167
+ lora_dropout:
168
+ lora_target_linear:
169
+ lora_fan_in_fan_out:
170
+
171
+ wandb_project: 27b-nemo-config-fft
172
+ wandb_entity:
173
+ wandb_watch:
174
+ wandb_name: attempt-01
175
+ wandb_log_model:
176
+
177
+ gradient_accumulation_steps: 8
178
+ micro_batch_size: 1
179
+ num_epochs: 4
180
+ optimizer: paged_adamw_8bit
181
+ lr_scheduler: cosine
182
+ learning_rate: 0.00001
183
+
184
+ train_on_inputs: false
185
+ group_by_length: false
186
+ bf16: auto
187
+ fp16:
188
+ tf32: false
189
+
190
+ gradient_checkpointing: true
191
+ early_stopping_patience:
192
+ auto_resume_from_checkpoints: true
193
+ local_rank:
194
+ logging_steps: 1
195
+ xformers_attention:
196
+ flash_attention: true
197
+
198
+ warmup_steps: 10
199
+ evals_per_epoch:
200
+ eval_table_size:
201
+ eval_max_new_tokens:
202
+ saves_per_epoch: 2
203
+ debug:
204
+ deepspeed: deepspeed_configs/zero3_bf16.json
205
+ weight_decay: 0.01
206
+ fsdp:
207
+ fsdp_config:
208
+ special_tokens:
209
+ pad_token: <pad>
210
+ ```
211
+ </details><br>
212
+
213
+ ## Credits
214
+ We'd like to thank Recursal / Featherless for sponsoring the compute for this train, Featherless has been hosting our Magnum models since the first 72 B and has given thousands of people access to our models and helped us grow.
215
+
216
+ We would also like to thank all members of Anthracite who made this finetune possible.
217
+
218
+ ## Datasets
219
+ - [anthracite-org/c2_logs_16k_llama_v1.1](https://huggingface.co/datasets/anthracite-org/c2_logs_16k_llama_v1.1)
220
+ - [NewEden/Claude-Instruct-5K](https://huggingface.co/datasets/NewEden/Claude-Instruct-5K)
221
+ - [anthracite-org/kalo-opus-instruct-22k-no-refusal](https://huggingface.co/datasets/anthracite-org/kalo-opus-instruct-22k-no-refusal)
222
+ - [Epiculous/SynthRP-Gens-v1.1-Filtered-n-Cleaned](https://huggingface.co/datasets/Epiculous/SynthRP-Gens-v1.1-Filtered-n-Cleaned)
223
+ - [lodrick-the-lafted/kalo-opus-instruct-3k-filtered](https://huggingface.co/datasets/lodrick-the-lafted/kalo-opus-instruct-3k-filtered)
224
+ - [anthracite-org/nopm_claude_writing_fixed](https://huggingface.co/datasets/anthracite-org/nopm_claude_writing_fixed)
225
+ - [Epiculous/Synthstruct-Gens-v1.1-Filtered-n-Cleaned](https://huggingface.co/datasets/Epiculous/Synthstruct-Gens-v1.1-Filtered-n-Cleaned)
226
+ - [anthracite-org/kalo_opus_misc_240827](https://huggingface.co/datasets/anthracite-org/kalo_opus_misc_240827)
227
+ - [anthracite-org/kalo_misc_part2](https://huggingface.co/datasets/anthracite-org/kalo_misc_part2)
228
+
229
+ ## Training
230
+ The training was done for 2 epochs. We used 8x[H100s](https://www.nvidia.com/en-us/data-center/h100/) GPUs graciously provided by [Recursal AI](https://recursal.ai/) / [Featherless AI](https://featherless.ai/) for the full-parameter fine-tuning of the model.
231
+
232
+ [<img src="https://raw.githubusercontent.com/OpenAccess-AI-Collective/axolotl/main/image/axolotl-badge-web.png" alt="Built with Axolotl" width="200" height="32"/>](https://github.com/OpenAccess-AI-Collective/axolotl)
233
+
234
+ ## Safety
235
+ ...