johannhartmann commited on
Commit
616adee
1 Parent(s): e45b813

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +110 -0
README.md ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - merge
4
+ - mergekit
5
+ - lazymergekit
6
+ - DiscoResearch/DiscoLM_German_7b_v1
7
+ - DRXD1000/Phoenix
8
+ - VAGOsolutions/SauerkrautLM-7b-v1-mistral
9
+ - malteos/hermeo-7b
10
+ base_model:
11
+ - DiscoResearch/DiscoLM_German_7b_v1
12
+ - DRXD1000/Phoenix
13
+ - VAGOsolutions/SauerkrautLM-7b-v1-mistral
14
+ - malteos/hermeo-7b
15
+ ---
16
+
17
+ # Wiedervereinigung-7b-dpo-laser-AWQ
18
+
19
+ ![image/png](https://huggingface.co/mayflowergmbh/Wiedervereinigung-7b/resolve/main/Wiedervereinigung-7b.png)
20
+
21
+ Some of the best german models with 7b parameters as lasered dpo-trained dare_ties merge, quantized using awq.
22
+
23
+ Since the original models based on mistral - three of them on the brilliant german LeoLM/leo-mistral-hessianai-7b - they are reunited in this merged model.
24
+ Hence the name, no right wing or nationalistic ideas involved :-). To improve the result quality they are dpo-trained with a german translation of intel-orca-dpo using our german fork of [LLaMA-Factory](https://github.com/mayflower/LLaMA-Factory).
25
+ After that this model got a [laserRMT](https://github.com/cognitivecomputations/laserRMT) treatment with german datasets.
26
+
27
+ Wiedervereinigung-7b itself is a [LazyMergekit](https://colab.research.google.com/drive/1obulZ1ROXHjYLn6PPZJwRR6GzgQogxxb?usp=sharing) merge of:
28
+ * [DiscoResearch/DiscoLM_German_7b_v1](https://huggingface.co/DiscoResearch/DiscoLM_German_7b_v1)
29
+ * [DRXD1000/Phoenix](https://huggingface.co/DRXD1000/Phoenix)
30
+ * [VAGOsolutions/SauerkrautLM-7b-v1-mistral](https://huggingface.co/VAGOsolutions/SauerkrautLM-7b-v1-mistral)
31
+ * [malteos/hermeo-7b](https://huggingface.co/malteos/hermeo-7b)
32
+
33
+ All the actual heavylifting has been done by the creators of these models.
34
+
35
+ ## 🧩 Configuration
36
+
37
+ ```yaml
38
+ models:
39
+ - model: LeoLM/leo-mistral-hessianai-7b
40
+ # No parameters necessary for base model
41
+ - model: DiscoResearch/DiscoLM_German_7b_v1
42
+ parameters:
43
+ density: 0.6
44
+ weight: 0.25
45
+ - model: DRXD1000/Phoenix
46
+ parameters:
47
+ density: 0.6
48
+ weight: 0.25
49
+ - model: VAGOsolutions/SauerkrautLM-7b-v1-mistral
50
+ parameters:
51
+ density: 0.6
52
+ weight: 0.25
53
+ - model: malteos/hermeo-7b
54
+ parameters:
55
+ density: 0.6
56
+ weight: 0.25
57
+ merge_method: dare_ties
58
+ base_model: LeoLM/leo-mistral-hessianai-7b
59
+ parameters:
60
+ int8_mask: true
61
+ dtype: bfloat16
62
+ ```
63
+
64
+ ## mt-bench-de
65
+
66
+ Using laser and dpo results seems to help.
67
+
68
+ ```json
69
+ {
70
+ "first_turn": 7.3,
71
+ "second_turn": 6.6,
72
+ "categories": {
73
+ "writing": 8.6,
74
+ "roleplay": 8.1,
75
+ "reasoning": 5.25,
76
+ "math": 3.7,
77
+ "coding": 4.35,
78
+ "extraction": 8.15,
79
+ "stem": 8.875,
80
+ "humanities": 8.875
81
+ },
82
+ "average": 6.97
83
+ }
84
+
85
+ ```
86
+
87
+ ## 💻 Usage
88
+
89
+ ```python
90
+ !pip install -qU transformers accelerate
91
+
92
+ from transformers import AutoTokenizer
93
+ import transformers
94
+ import torch
95
+
96
+ model = "mayflowergmbh/Wiedervereinigung-7b-dpo-laser"
97
+ messages = [{"role": "user", "content": "Was ist ein large language model?"}]
98
+
99
+ tokenizer = AutoTokenizer.from_pretrained(model)
100
+ prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
101
+ pipeline = transformers.pipeline(
102
+ "text-generation",
103
+ model=model,
104
+ torch_dtype=torch.float16,
105
+ device_map="auto",
106
+ )
107
+
108
+ outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
109
+ print(outputs[0]["generated_text"])
110
+ ```