Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,108 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
tags:
|
3 |
+
- merge
|
4 |
+
- mergekit
|
5 |
+
- lazymergekit
|
6 |
+
- FelixChao/WestSeverus-7B-DPO-v2
|
7 |
+
- mayflowergmbh/Wiedervereinigung-7b-dpo-laser
|
8 |
+
- cognitivecomputations/openchat-3.5-0106-laser
|
9 |
+
base_model:
|
10 |
+
- FelixChao/WestSeverus-7B-DPO-v2
|
11 |
+
- mayflowergmbh/Wiedervereinigung-7b-dpo-laser
|
12 |
+
- cognitivecomputations/openchat-3.5-0106-laser
|
13 |
+
license: apache-2.0
|
14 |
+
language:
|
15 |
+
- de
|
16 |
+
---
|
17 |
+
|
18 |
+
# Brezn-7B
|
19 |
+
|
20 |
+
This is the GGUF quantized version of the dpo aligned merge of the following models using [LazyMergekit](https://colab.research.google.com/drive/1obulZ1ROXHjYLn6PPZJwRR6GzgQogxxb?usp=sharing):
|
21 |
+
* [FelixChao/WestSeverus-7B-DPO-v2](https://huggingface.co/FelixChao/WestSeverus-7B-DPO-v2)
|
22 |
+
* [mayflowergmbh/Wiedervereinigung-7b-dpo-laser](https://huggingface.co/mayflowergmbh/Wiedervereinigung-7b-dpo-laser)
|
23 |
+
* [cognitivecomputations/openchat-3.5-0106-laser](https://huggingface.co/cognitivecomputations/openchat-3.5-0106-laser)
|
24 |
+
|
25 |
+
![image/png](https://huggingface.co/mayflowergmbh/Brezn-7b/resolve/main/brezn.png)
|
26 |
+
## 💻 Usage
|
27 |
+
|
28 |
+
In order to leverage instruction fine-tuning, your prompt should be surrounded by `[INST]` and `[/INST]` tokens. The very first instruction should begin with a begin of sentence id. The next instructions should not. The assistant generation will be ended by the end-of-sentence token id.
|
29 |
+
|
30 |
+
E.g.
|
31 |
+
```
|
32 |
+
text = "<s>[INST] What is your favourite condiment? [/INST]"
|
33 |
+
"Well, I'm quite partial to a good squeeze of fresh lemon juice. It adds just the right amount of zesty flavour to whatever I'm cooking up in the kitchen!</s> "
|
34 |
+
"[INST] Do you have mayonnaise recipes? [/INST]"
|
35 |
+
```
|
36 |
+
|
37 |
+
This format is available as a [chat template](https://huggingface.co/docs/transformers/main/chat_templating) via the `apply_chat_template()` method:
|
38 |
+
|
39 |
+
```python
|
40 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
41 |
+
|
42 |
+
device = "cuda" # the device to load the model onto
|
43 |
+
|
44 |
+
model = AutoModelForCausalLM.from_pretrained("mayflowergmbh/Brezn-7b")
|
45 |
+
tokenizer = AutoTokenizer.from_pretrained("mayflowergmbh/Brezn-7b")
|
46 |
+
|
47 |
+
messages = [
|
48 |
+
{"role": "user", "content": "Was ist dein Lieblingsgewürz??"},
|
49 |
+
{"role": "assistant", "content": "Nun, ich mag besonders gerne einen guten Spritzer frischen Zitronensaft. Er fügt genau die richtige Menge an würzigem Geschmack hinzu, egal was ich gerade in der Küche zubereite!"},
|
50 |
+
{"role": "user", "content": "Hast du Mayonnaise-Rezepte?"}
|
51 |
+
]
|
52 |
+
|
53 |
+
encodeds = tokenizer.apply_chat_template(messages, return_tensors="pt")
|
54 |
+
|
55 |
+
model_inputs = encodeds.to(device)
|
56 |
+
model.to(device)
|
57 |
+
|
58 |
+
generated_ids = model.generate(model_inputs, max_new_tokens=1000, do_sample=True)
|
59 |
+
decoded = tokenizer.batch_decode(generated_ids)
|
60 |
+
print(decoded[0])
|
61 |
+
```
|
62 |
+
|
63 |
+
|
64 |
+
## mt-bench-de
|
65 |
+
```yaml
|
66 |
+
{
|
67 |
+
"first_turn": 7.6625,
|
68 |
+
"second_turn": 7.31875,
|
69 |
+
"categories": {
|
70 |
+
"writing": 8.75,
|
71 |
+
"roleplay": 8.5,
|
72 |
+
"reasoning": 6.1,
|
73 |
+
"math": 5.05,
|
74 |
+
"coding": 5.4,
|
75 |
+
"extraction": 7.975,
|
76 |
+
"stem": 9,
|
77 |
+
"humanities": 9.15
|
78 |
+
},
|
79 |
+
"average": 7.490625
|
80 |
+
}
|
81 |
+
```
|
82 |
+
|
83 |
+
## 🧩 Configuration
|
84 |
+
|
85 |
+
```yaml
|
86 |
+
models:
|
87 |
+
- model: mistralai/Mistral-7B-v0.1
|
88 |
+
# no parameters necessary for base model
|
89 |
+
- model: FelixChao/WestSeverus-7B-DPO-v2
|
90 |
+
parameters:
|
91 |
+
density: 0.60
|
92 |
+
weight: 0.30
|
93 |
+
- model: mayflowergmbh/Wiedervereinigung-7b-dpo-laser
|
94 |
+
parameters:
|
95 |
+
density: 0.65
|
96 |
+
weight: 0.40
|
97 |
+
- model: cognitivecomputations/openchat-3.5-0106-laser
|
98 |
+
parameters:
|
99 |
+
density: 0.6
|
100 |
+
weight: 0.3
|
101 |
+
merge_method: dare_ties
|
102 |
+
base_model: mistralai/Mistral-7B-v0.1
|
103 |
+
parameters:
|
104 |
+
int8_mask: true
|
105 |
+
dtype: bfloat16
|
106 |
+
random_seed: 0
|
107 |
+
```
|
108 |
+
|