File size: 3,530 Bytes
337efde
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f09f25c
337efde
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
---
tags:
- merge
- mergekit
- lazymergekit
- FelixChao/WestSeverus-7B-DPO-v2
- mayflowergmbh/Wiedervereinigung-7b-dpo-laser
- cognitivecomputations/openchat-3.5-0106-laser
base_model:
- FelixChao/WestSeverus-7B-DPO-v2
- mayflowergmbh/Wiedervereinigung-7b-dpo-laser
- cognitivecomputations/openchat-3.5-0106-laser
license: apache-2.0
language:
- de
---

# Brezn-7B

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):
* [FelixChao/WestSeverus-7B-DPO-v2](https://huggingface.co/FelixChao/WestSeverus-7B-DPO-v2)
* [mayflowergmbh/Wiedervereinigung-7b-dpo-laser](https://huggingface.co/mayflowergmbh/Wiedervereinigung-7b-dpo-laser)
* [cognitivecomputations/openchat-3.5-0106-laser](https://huggingface.co/cognitivecomputations/openchat-3.5-0106-laser)

![image/png](https://huggingface.co/mayflowergmbh/Brezn-7b/resolve/main/pretzel.png)
## 💻 Usage

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.

E.g.
```
text = "<s>[INST] What is your favourite condiment? [/INST]"
"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> "
"[INST] Do you have mayonnaise recipes? [/INST]"
```

This format is available as a [chat template](https://huggingface.co/docs/transformers/main/chat_templating) via the `apply_chat_template()` method:

```python
from transformers import AutoModelForCausalLM, AutoTokenizer

device = "cuda" # the device to load the model onto

model = AutoModelForCausalLM.from_pretrained("mayflowergmbh/Brezn-7b")
tokenizer = AutoTokenizer.from_pretrained("mayflowergmbh/Brezn-7b")

messages = [
    {"role": "user", "content": "Was ist dein Lieblingsgewürz??"},
    {"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!"},
    {"role": "user", "content": "Hast du Mayonnaise-Rezepte?"}
]

encodeds = tokenizer.apply_chat_template(messages, return_tensors="pt")

model_inputs = encodeds.to(device)
model.to(device)

generated_ids = model.generate(model_inputs, max_new_tokens=1000, do_sample=True)
decoded = tokenizer.batch_decode(generated_ids)
print(decoded[0])
```


## mt-bench-de
```yaml
{
    "first_turn": 7.6625,
    "second_turn": 7.31875,
    "categories": {
        "writing": 8.75,
        "roleplay": 8.5,
        "reasoning": 6.1,
        "math": 5.05,
        "coding": 5.4,
        "extraction": 7.975,
        "stem": 9,
        "humanities": 9.15
    },
    "average": 7.490625
}
```

## 🧩 Configuration

```yaml
models:
  - model: mistralai/Mistral-7B-v0.1
    # no parameters necessary for base model
  - model: FelixChao/WestSeverus-7B-DPO-v2
    parameters:
      density: 0.60
      weight: 0.30
  - model: mayflowergmbh/Wiedervereinigung-7b-dpo-laser
    parameters:
      density: 0.65
      weight: 0.40
  - model: cognitivecomputations/openchat-3.5-0106-laser
    parameters:
      density: 0.6
      weight: 0.3
merge_method: dare_ties
base_model: mistralai/Mistral-7B-v0.1
parameters:
  int8_mask: true
dtype: bfloat16
random_seed: 0
```