johannhartmann commited on
Commit
e3d8e9c
·
verified ·
1 Parent(s): d177acd

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +108 -0
README.md ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
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 an dare_ties merge.
22
+ 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.
23
+ Hence the name. To improve result quality they are dpo-trained with a german translation of oaast-dpo using our german fork of [LLaMA-Factory](https://github.com/mayflower/LLaMA-Factory).
24
+
25
+ Wiedervereinigung-7b itself is a [LazyMergekit](https://colab.research.google.com/drive/1obulZ1ROXHjYLn6PPZJwRR6GzgQogxxb?usp=sharing) merge of:
26
+ * [DiscoResearch/DiscoLM_German_7b_v1](https://huggingface.co/DiscoResearch/DiscoLM_German_7b_v1)
27
+ * [DRXD1000/Phoenix](https://huggingface.co/DRXD1000/Phoenix)
28
+ * [VAGOsolutions/SauerkrautLM-7b-v1-mistral](https://huggingface.co/VAGOsolutions/SauerkrautLM-7b-v1-mistral)
29
+ * [malteos/hermeo-7b](https://huggingface.co/malteos/hermeo-7b)
30
+
31
+ All the actual heavylifting has been done by the creators of these models.
32
+
33
+ ## 🧩 Configuration
34
+
35
+ ```yaml
36
+ models:
37
+ - model: LeoLM/leo-mistral-hessianai-7b
38
+ # No parameters necessary for base model
39
+ - model: DiscoResearch/DiscoLM_German_7b_v1
40
+ parameters:
41
+ density: 0.6
42
+ weight: 0.25
43
+ - model: DRXD1000/Phoenix
44
+ parameters:
45
+ density: 0.6
46
+ weight: 0.25
47
+ - model: VAGOsolutions/SauerkrautLM-7b-v1-mistral
48
+ parameters:
49
+ density: 0.6
50
+ weight: 0.25
51
+ - model: malteos/hermeo-7b
52
+ parameters:
53
+ density: 0.6
54
+ weight: 0.25
55
+ merge_method: dare_ties
56
+ base_model: LeoLM/leo-mistral-hessianai-7b
57
+ parameters:
58
+ int8_mask: true
59
+ dtype: bfloat16
60
+ ```
61
+
62
+ ## mt-bench-de
63
+
64
+ The results are not bad, but some additional investment into dpo
65
+ finetuning would probably help a lot.
66
+
67
+ ```json
68
+ {
69
+ "first_turn": 6.4625,
70
+ "second_turn": 5.6375,
71
+ "categories": {
72
+ "writing": 7.6,
73
+ "roleplay": 7.5,
74
+ "reasoning": 4.25,
75
+ "math": 3.35,
76
+ "coding": 3.1,
77
+ "extraction": 8.15,
78
+ "stem": 6.55,
79
+ "humanities": 7.9
80
+ },
81
+ "average": 6.050000000000001
82
+ }
83
+ ```
84
+
85
+ ## 💻 Usage
86
+
87
+ ```python
88
+ !pip install -qU transformers accelerate
89
+
90
+ from transformers import AutoTokenizer
91
+ import transformers
92
+ import torch
93
+
94
+ model = "mayflowergmbh/Wiedervereinigung-7b-dpo"
95
+ messages = [{"role": "user", "content": "Was ist ein large language model?"}]
96
+
97
+ tokenizer = AutoTokenizer.from_pretrained(model)
98
+ prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
99
+ pipeline = transformers.pipeline(
100
+ "text-generation",
101
+ model=model,
102
+ torch_dtype=torch.float16,
103
+ device_map="auto",
104
+ )
105
+
106
+ outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
107
+ print(outputs[0]["generated_text"])
108
+ ```