automerger
commited on
Commit
•
7644300
1
Parent(s):
24dfaaa
Upload folder using huggingface_hub
Browse files
README.md
ADDED
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
tags:
|
4 |
+
- merge
|
5 |
+
- mergekit
|
6 |
+
- lazymergekit
|
7 |
+
- automerger
|
8 |
+
base_model:
|
9 |
+
- yam-peleg/Experiment31-7B
|
10 |
+
- yam-peleg/Experiment29-7B
|
11 |
+
---
|
12 |
+
|
13 |
+
# Experiment31Experiment29-7B
|
14 |
+
|
15 |
+
Experiment31Experiment29-7B is an automated merge created by [Maxime Labonne](https://huggingface.co/mlabonne) using the following configuration.
|
16 |
+
* [yam-peleg/Experiment31-7B](https://huggingface.co/yam-peleg/Experiment31-7B)
|
17 |
+
* [yam-peleg/Experiment29-7B](https://huggingface.co/yam-peleg/Experiment29-7B)
|
18 |
+
|
19 |
+
## 🧩 Configuration
|
20 |
+
|
21 |
+
```yaml
|
22 |
+
slices:
|
23 |
+
- sources:
|
24 |
+
- model: yam-peleg/Experiment31-7B
|
25 |
+
layer_range: [0, 32]
|
26 |
+
- model: yam-peleg/Experiment29-7B
|
27 |
+
layer_range: [0, 32]
|
28 |
+
merge_method: slerp
|
29 |
+
base_model: yam-peleg/Experiment31-7B
|
30 |
+
parameters:
|
31 |
+
t:
|
32 |
+
- filter: self_attn
|
33 |
+
value: [0, 0.5, 0.3, 0.7, 1]
|
34 |
+
- filter: mlp
|
35 |
+
value: [1, 0.5, 0.7, 0.3, 0]
|
36 |
+
- value: 0.5
|
37 |
+
dtype: bfloat16
|
38 |
+
random_seed: 0
|
39 |
+
```
|
40 |
+
|
41 |
+
## 💻 Usage
|
42 |
+
|
43 |
+
```python
|
44 |
+
!pip install -qU transformers accelerate
|
45 |
+
|
46 |
+
from transformers import AutoTokenizer
|
47 |
+
import transformers
|
48 |
+
import torch
|
49 |
+
|
50 |
+
model = "automerger/Experiment31Experiment29-7B"
|
51 |
+
messages = [{"role": "user", "content": "What is a large language model?"}]
|
52 |
+
|
53 |
+
tokenizer = AutoTokenizer.from_pretrained(model)
|
54 |
+
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
55 |
+
pipeline = transformers.pipeline(
|
56 |
+
"text-generation",
|
57 |
+
model=model,
|
58 |
+
torch_dtype=torch.float16,
|
59 |
+
device_map="auto",
|
60 |
+
)
|
61 |
+
|
62 |
+
outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
|
63 |
+
print(outputs[0]["generated_text"])
|
64 |
+
```
|