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