lucyknada commited on
Commit
ff16947
·
verified ·
1 Parent(s): 27d043b

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +207 -0
README.md ADDED
@@ -0,0 +1,207 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - en
5
+ tags:
6
+ - chat
7
+ pipeline_tag: text-generation
8
+ library_name: transformers
9
+ ---
10
+
11
+
12
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/658a46cbfb9c2bdfae75b3a6/ZmOOkB2QwItLmoqmnxNWO.png)
13
+ ## 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-72b).
14
+
15
+ This is a series of models designed to replicate the prose quality of the Claude 3 models, specifically Sonnet and Opus.
16
+
17
+ experimental because trained on top of instruct; but turned out amazing; hence code named magnum-alter, the original model that kickstarted the v4 family
18
+
19
+ This model is fine-tuned on top of [Qwen2.5-72B-Instruct](https://huggingface.co/Qwen/Qwen2.5-72B-Instruct).
20
+
21
+ ## Prompting
22
+ A typical input would look like this:
23
+
24
+ ```py
25
+ <|im_start|>system
26
+ system prompt<|im_end|>
27
+ <|im_start|>user
28
+ Hi there!<|im_end|>
29
+ <|im_start|>assistant
30
+ Nice to meet you!<|im_end|>
31
+ <|im_start|>user
32
+ Can I ask a question?<|im_end|>
33
+ <|im_start|>assistant
34
+ ```
35
+
36
+ ## SillyTavern templates
37
+
38
+ Below are Instruct and Context templates for use within SillyTavern.
39
+
40
+ <details><summary>context template</summary>
41
+
42
+ ```yaml
43
+ {
44
+ "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",
45
+ "example_separator": "",
46
+ "chat_start": "",
47
+ "use_stop_strings": false,
48
+ "allow_jailbreak": false,
49
+ "always_force_name2": true,
50
+ "trim_sentences": false,
51
+ "include_newline": false,
52
+ "single_line": false,
53
+ "name": "Magnum ChatML"
54
+ }
55
+ ```
56
+
57
+ </details><br>
58
+ <details><summary>instruct template</summary>
59
+
60
+ ```yaml
61
+ {
62
+ "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>.",
63
+ "input_sequence": "<|im_start|>user\n",
64
+ "output_sequence": "<|im_start|>assistant\n",
65
+ "last_output_sequence": "",
66
+ "system_sequence": "<|im_start|>system\n",
67
+ "stop_sequence": "<|im_end|>",
68
+ "wrap": false,
69
+ "macro": true,
70
+ "names": true,
71
+ "names_force_groups": true,
72
+ "activation_regex": "",
73
+ "system_sequence_prefix": "",
74
+ "system_sequence_suffix": "",
75
+ "first_output_sequence": "",
76
+ "skip_examples": false,
77
+ "output_suffix": "<|im_end|>\n",
78
+ "input_suffix": "<|im_end|>\n",
79
+ "system_suffix": "<|im_end|>\n",
80
+ "user_alignment_message": "",
81
+ "system_same_as_user": false,
82
+ "last_system_sequence": "",
83
+ "name": "Magnum ChatML"
84
+ }
85
+ ```
86
+
87
+ </details><br>
88
+
89
+ ## Axolotl config
90
+
91
+ <details><summary>See axolotl config</summary>
92
+
93
+ ```yaml
94
+ base_model: /workspace/data/models/Qwen2.5-72B-Instruct
95
+ model_type: AutoModelForCausalLM
96
+ tokenizer_type: AutoTokenizer
97
+
98
+ plugins:
99
+ - axolotl.integrations.liger.LigerPlugin
100
+ liger_rope: true
101
+ liger_rms_norm: true
102
+ liger_swiglu: true
103
+ liger_fused_linear_cross_entropy: true
104
+
105
+ load_in_8bit: false
106
+ load_in_4bit: false
107
+ strict: false
108
+
109
+ datasets:
110
+ - path: anthracite-org/c2_logs_32k_llama3_qwen2_v1.2
111
+ type: sharegpt
112
+ conversation: chatml
113
+ - path: anthracite-org/kalo-opus-instruct-22k-no-refusal
114
+ type: sharegpt
115
+ conversation: chatml
116
+ - path: lodrick-the-lafted/kalo-opus-instruct-3k-filtered
117
+ type: sharegpt
118
+ conversation: chatml
119
+ - path: anthracite-org/nopm_claude_writing_fixed
120
+ type: sharegpt
121
+ conversation: chatml
122
+ - path: anthracite-org/kalo_opus_misc_240827
123
+ type: sharegpt
124
+ conversation: chatml
125
+ - path: anthracite-org/kalo_misc_part2
126
+ type: sharegpt
127
+ conversation: chatml
128
+ #chat_template: chatml
129
+ shuffle_merged_datasets: true
130
+ #default_system_message: "You are an assistant that responds to the user."
131
+ dataset_prepared_path: /workspace/data/magnum-72b-data
132
+ val_set_size: 0.0
133
+ output_dir: /workspace/data/72b-fft-out
134
+
135
+ sequence_len: 32768
136
+ sample_packing: true
137
+ pad_to_sequence_len: true
138
+
139
+ adapter:
140
+ lora_model_dir:
141
+ lora_r:
142
+ lora_alpha:
143
+ lora_dropout:
144
+ lora_target_linear:
145
+ lora_fan_in_fan_out:
146
+
147
+ wandb_project: 72b-magnum-fft
148
+ wandb_entity:
149
+ wandb_watch:
150
+ wandb_name: alter-attempt-01
151
+ wandb_log_model:
152
+
153
+ gradient_accumulation_steps: 2
154
+ micro_batch_size: 1
155
+ num_epochs: 2
156
+ optimizer: adamw_bnb_8bit
157
+ lr_scheduler: cosine
158
+ learning_rate: 0.000004
159
+
160
+ train_on_inputs: false
161
+ group_by_length: false
162
+ bf16: auto
163
+ fp16:
164
+ tf32: false
165
+
166
+ gradient_checkpointing: true
167
+ early_stopping_patience:
168
+ resume_from_checkpoint:
169
+ local_rank:
170
+ logging_steps: 1
171
+ xformers_attention:
172
+ flash_attention: true
173
+
174
+ warmup_steps: 40
175
+ evals_per_epoch:
176
+ eval_table_size:
177
+ eval_max_new_tokens:
178
+ saves_per_epoch: 2
179
+ debug:
180
+ deepspeed: deepspeed_configs/zero3_bf16.json
181
+ weight_decay: 0.01
182
+ fsdp:
183
+ fsdp_config:
184
+ special_tokens:
185
+ ```
186
+ </details><br>
187
+
188
+ ## Credits
189
+ 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.
190
+
191
+ We would also like to thank all members of Anthracite who made this finetune possible.
192
+
193
+ ## Datasets
194
+ - [anthracite-org/c2_logs_32k_llama3_qwen2_v1.2](https://huggingface.co/datasets/anthracite-org/c2_logs_32k_llama3_qwen2_v1.2)
195
+ - [anthracite-org/kalo-opus-instruct-22k-no-refusal](https://huggingface.co/datasets/anthracite-org/kalo-opus-instruct-22k-no-refusal)
196
+ - [lodrick-the-lafted/kalo-opus-instruct-3k-filtered](https://huggingface.co/datasets/lodrick-the-lafted/kalo-opus-instruct-3k-filtered)
197
+ - [anthracite-org/nopm_claude_writing_fixed](https://huggingface.co/datasets/anthracite-org/nopm_claude_writing_fixed)
198
+ - [anthracite-org/kalo_opus_misc_240827](https://huggingface.co/datasets/anthracite-org/kalo_opus_misc_240827)
199
+ - [anthracite-org/kalo_misc_part2](https://huggingface.co/datasets/anthracite-org/kalo_misc_part2)
200
+
201
+ ## Training
202
+ 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.
203
+
204
+ [<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)
205
+
206
+ ## Safety
207
+ ...