Transformers
GGUF
Inference Endpoints
conversational
nbeerbower commited on
Commit
2ba724d
1 Parent(s): 65f564b

add model files

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ *.gguf filter=lfs diff=lfs merge=lfs -text
Mahou-1.2-llama3-8B-Q3_K_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ed32edbc34460c8bddb1c71897d4761fb616df84d4544a2f898858921ea37f97
3
+ size 4018917600
Mahou-1.2-llama3-8B-Q4_K_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:651b405dff71e4ce80e15cc6d393463f02833428535c56eb6bae113776775d62
3
+ size 4920733920
Mahou-1.2-llama3-8B-Q5_K_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:77eec7129cc0f5c2fb5daffdbc3739baebcda209511dc7926bdb8619d9d826c0
3
+ size 5732987104
README.md CHANGED
@@ -1,3 +1,103 @@
1
- ---
2
- license: llama3
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: transformers
3
+ tags: []
4
+ base_model:
5
+ - nbeerbower/llama3-KawaiiMahouSauce-8B
6
+ datasets:
7
+ - flammenai/Grill-preprod-v1_chatML
8
+ - flammenai/Grill-preprod-v2_chatML
9
+ license: llama3
10
+ ---
11
+
12
+ ![image/png](https://huggingface.co/flammenai/Mahou-1.0-mistral-7B/resolve/main/mahou1.png)
13
+
14
+ # Mahou-1.2-llama3-8B
15
+
16
+ Mahou is our attempt to build a production-ready conversational/roleplay LLM.
17
+
18
+ Future versions will be released iteratively and finetuned from flammen.ai conversational data.
19
+
20
+ ### Chat Format
21
+
22
+ This model has been trained to use ChatML format.
23
+
24
+ ```
25
+ <|im_start|>system
26
+ {{system}}<|im_end|>
27
+ <|im_start|>{{char}}
28
+ {{message}}<|im_end|>
29
+ <|im_start|>{{user}}
30
+ {{message}}<|im_end|>
31
+ ```
32
+
33
+ ### ST Settings
34
+
35
+ 1. Use ChatML for the Context Template.
36
+ 2. Turn on Instruct Mode for ChatML.
37
+ 3. Use the following stopping strings: `["<", "|", "<|", "\n"]`
38
+
39
+ ### License
40
+
41
+ This model is based on Meta Llama-3-8B and is governed by the [META LLAMA 3 COMMUNITY LICENSE AGREEMENT](LICENSE).
42
+
43
+ ### Method
44
+
45
+ Finetuned using an A100 on Google Colab.
46
+
47
+ [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)
48
+
49
+ ### Configuration
50
+
51
+ LoRA, model, and training settings:
52
+
53
+ ```python
54
+ # LoRA configuration
55
+ peft_config = LoraConfig(
56
+ r=16,
57
+ lora_alpha=16,
58
+ lora_dropout=0.05,
59
+ bias="none",
60
+ task_type="CAUSAL_LM",
61
+ target_modules=['k_proj', 'gate_proj', 'v_proj', 'up_proj', 'q_proj', 'o_proj', 'down_proj']
62
+ )
63
+ # Model to fine-tune
64
+ model = AutoModelForCausalLM.from_pretrained(
65
+ model_name,
66
+ torch_dtype=torch.bfloat16,
67
+ load_in_4bit=True
68
+ )
69
+ model.config.use_cache = False
70
+ # Reference model
71
+ ref_model = AutoModelForCausalLM.from_pretrained(
72
+ model_name,
73
+ torch_dtype=torch.bfloat16,
74
+ load_in_4bit=True
75
+ )
76
+ # Training arguments
77
+ training_args = TrainingArguments(
78
+ per_device_train_batch_size=2,
79
+ gradient_accumulation_steps=4,
80
+ gradient_checkpointing=True,
81
+ learning_rate=5e-5,
82
+ lr_scheduler_type="cosine",
83
+ max_steps=1000,
84
+ save_strategy="no",
85
+ logging_steps=1,
86
+ output_dir=new_model,
87
+ optim="paged_adamw_32bit",
88
+ warmup_steps=100,
89
+ bf16=True,
90
+ report_to="wandb",
91
+ )
92
+ # Create DPO trainer
93
+ dpo_trainer = DPOTrainer(
94
+ model,
95
+ ref_model,
96
+ args=training_args,
97
+ train_dataset=dataset,
98
+ tokenizer=tokenizer,
99
+ peft_config=peft_config,
100
+ beta=0.1,
101
+ force_use_ref_model=True
102
+ )
103
+ ```