johannhartmann commited on
Commit
5d9dcdd
1 Parent(s): 258cd55

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +71 -0
README.md ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - merge
4
+ - mergekit
5
+ - lazymergekit
6
+ - mlabonne/OmniTruthyBeagle-7B-v0
7
+ - mayflowergmbh/Wiedervereinigung-7b-dpo-laser
8
+ - cognitivecomputations/openchat-3.5-0106-laser
9
+ base_model:
10
+ - mlabonne/OmniTruthyBeagle-7B-v0
11
+ - mayflowergmbh/Wiedervereinigung-7b-dpo-laser
12
+ - cognitivecomputations/openchat-3.5-0106-laser
13
+ ---
14
+
15
+ # Wiederchat-7b-dpo
16
+
17
+ Wiederchat-7b-dpo is a dpo-aligned merge of the following models using [LazyMergekit](https://colab.research.google.com/drive/1obulZ1ROXHjYLn6PPZJwRR6GzgQogxxb?usp=sharing):
18
+ * [mlabonne/OmniTruthyBeagle-7B-v0](https://huggingface.co/mlabonne/OmniTruthyBeagle-7B-v0)
19
+ * [mayflowergmbh/Wiedervereinigung-7b-dpo-laser](https://huggingface.co/mayflowergmbh/Wiedervereinigung-7b-dpo-laser)
20
+ * [cognitivecomputations/openchat-3.5-0106-laser](https://huggingface.co/cognitivecomputations/openchat-3.5-0106-laser)
21
+
22
+ ## 🧩 Configuration
23
+
24
+ ```yaml
25
+ models:
26
+ - model: mistralai/Mistral-7B-v0.1
27
+ # no parameters necessary for base model
28
+ - model: mlabonne/OmniTruthyBeagle-7B-v0
29
+ parameters:
30
+ density: 0.60
31
+ weight: 0.30
32
+ - model: mayflowergmbh/Wiedervereinigung-7b-dpo-laser
33
+ parameters:
34
+ density: 0.65
35
+ weight: 0.40
36
+ - model: cognitivecomputations/openchat-3.5-0106-laser
37
+ parameters:
38
+ density: 0.6
39
+ weight: 0.3
40
+ merge_method: dare_ties
41
+ base_model: mistralai/Mistral-7B-v0.1
42
+ parameters:
43
+ int8_mask: true
44
+ dtype: bfloat16
45
+ random_seed: 0
46
+ ```
47
+
48
+ ## 💻 Usage
49
+
50
+ ```python
51
+ !pip install -qU transformers accelerate
52
+
53
+ from transformers import AutoTokenizer
54
+ import transformers
55
+ import torch
56
+
57
+ model = "johannhartmann/Wiederchat-7b"
58
+ messages = [{"role": "user", "content": "What is a large language model?"}]
59
+
60
+ tokenizer = AutoTokenizer.from_pretrained(model)
61
+ prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
62
+ pipeline = transformers.pipeline(
63
+ "text-generation",
64
+ model=model,
65
+ torch_dtype=torch.float16,
66
+ device_map="auto",
67
+ )
68
+
69
+ outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
70
+ print(outputs[0]["generated_text"])
71
+ ```