Svak commited on
Commit
ad50c69
·
verified ·
1 Parent(s): 98e7d70

Create README.md

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