nbeerbower
commited on
Commit
•
0e5efe0
1
Parent(s):
522ad3a
add model files
Browse files- README.md +96 -3
- ggml-model-Q3_K_M.gguf +3 -0
- ggml-model-Q4_K_M.gguf +3 -0
- ggml-model-Q5_K_M.gguf +3 -0
README.md
CHANGED
@@ -1,3 +1,96 @@
|
|
1 |
-
---
|
2 |
-
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
library_name: transformers
|
3 |
+
license: apache-2.0
|
4 |
+
base_model:
|
5 |
+
- flammenai/Mahou-1.0-mistral-7B
|
6 |
+
datasets:
|
7 |
+
- flammenai/Grill-preprod-v1_chatML
|
8 |
+
---
|
9 |
+
![image/png](https://huggingface.co/flammenai/Mahou-1.0-mistral-7B/resolve/main/mahou1.png)
|
10 |
+
|
11 |
+
# Mahou-1.1-mistral-7B
|
12 |
+
|
13 |
+
Mahou is our attempt to build a production-ready conversational/roleplay LLM.
|
14 |
+
|
15 |
+
Future versions will be released iteratively and finetuned from flammen.ai conversational data.
|
16 |
+
|
17 |
+
### Chat Format
|
18 |
+
|
19 |
+
This model has been trained to use ChatML format.
|
20 |
+
|
21 |
+
```
|
22 |
+
<|im_start|>system
|
23 |
+
{{system}}<|im_end|>
|
24 |
+
<|im_start|>{{char}}
|
25 |
+
{{message}}<|im_end|>
|
26 |
+
<|im_start|>{{user}}
|
27 |
+
{{message}}<|im_end|>
|
28 |
+
```
|
29 |
+
|
30 |
+
### ST Settings
|
31 |
+
|
32 |
+
1. Use ChatML for the Context Template.
|
33 |
+
2. Turn on Instruct Mode for ChatML.
|
34 |
+
3. Use the following stopping strings: `["<", "|", "<|", "\n"]`
|
35 |
+
|
36 |
+
### Method
|
37 |
+
|
38 |
+
Finetuned using an A100 on Google Colab.
|
39 |
+
|
40 |
+
[Fine-tune a Mistral-7b model with Direct Preference Optimization](https://towardsdatascience.com/fine-tune-a-mistral-7b-model-with-direct-preference-optimization-708042745aac) - [Maxime Labonne](https://huggingface.co/mlabonne)
|
41 |
+
|
42 |
+
### Configuration
|
43 |
+
|
44 |
+
LoRA, model, and training settings:
|
45 |
+
|
46 |
+
```python
|
47 |
+
# LoRA configuration
|
48 |
+
peft_config = LoraConfig(
|
49 |
+
r=16,
|
50 |
+
lora_alpha=16,
|
51 |
+
lora_dropout=0.05,
|
52 |
+
bias="none",
|
53 |
+
task_type="CAUSAL_LM",
|
54 |
+
target_modules=['k_proj', 'gate_proj', 'v_proj', 'up_proj', 'q_proj', 'o_proj', 'down_proj']
|
55 |
+
)
|
56 |
+
# Model to fine-tune
|
57 |
+
model = AutoModelForCausalLM.from_pretrained(
|
58 |
+
model_name,
|
59 |
+
torch_dtype=torch.bfloat16,
|
60 |
+
load_in_4bit=True
|
61 |
+
)
|
62 |
+
model.config.use_cache = False
|
63 |
+
# Reference model
|
64 |
+
ref_model = AutoModelForCausalLM.from_pretrained(
|
65 |
+
model_name,
|
66 |
+
torch_dtype=torch.bfloat16,
|
67 |
+
load_in_4bit=True
|
68 |
+
)
|
69 |
+
# Training arguments
|
70 |
+
training_args = TrainingArguments(
|
71 |
+
per_device_train_batch_size=2,
|
72 |
+
gradient_accumulation_steps=2,
|
73 |
+
gradient_checkpointing=True,
|
74 |
+
learning_rate=3e-5,
|
75 |
+
lr_scheduler_type="cosine",
|
76 |
+
max_steps=200,
|
77 |
+
save_strategy="no",
|
78 |
+
logging_steps=1,
|
79 |
+
output_dir=new_model,
|
80 |
+
optim="paged_adamw_32bit",
|
81 |
+
warmup_steps=100,
|
82 |
+
bf16=True,
|
83 |
+
report_to="wandb",
|
84 |
+
)
|
85 |
+
# Create DPO trainer
|
86 |
+
dpo_trainer = DPOTrainer(
|
87 |
+
model,
|
88 |
+
ref_model,
|
89 |
+
args=training_args,
|
90 |
+
train_dataset=dataset,
|
91 |
+
tokenizer=tokenizer,
|
92 |
+
peft_config=peft_config,
|
93 |
+
beta=0.1,
|
94 |
+
force_use_ref_model=True
|
95 |
+
)
|
96 |
+
```
|
ggml-model-Q3_K_M.gguf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:be36b35e91549e2a5e9434c00792e376a02e70af4d4b25d608a63a1da30ed06d
|
3 |
+
size 3518986016
|
ggml-model-Q4_K_M.gguf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:24031b823ae87a86491f6c2cb19a627b24440cef2e96208bd173c66614095ff7
|
3 |
+
size 4368439072
|
ggml-model-Q5_K_M.gguf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5661398f8e5ad6a788868e7711bb13d154331348e6e206bf1ab7865cc66c20d1
|
3 |
+
size 5131409184
|