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