automerger
commited on
Commit
•
9bf8840
1
Parent(s):
4bcb2da
Upload folder using huggingface_hub
Browse files
README.md
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: cc-by-nc-4.0
|
3 |
+
tags:
|
4 |
+
- merge
|
5 |
+
- mergekit
|
6 |
+
- lazymergekit
|
7 |
+
- automerger
|
8 |
+
---
|
9 |
+
|
10 |
+
# LlamaMahou-8B
|
11 |
+
|
12 |
+
LlamaMahou-8B is an automated merge created by [Maxime Labonne](https://huggingface.co/mlabonne) using the following configuration.
|
13 |
+
|
14 |
+
## 🧩 Configuration
|
15 |
+
|
16 |
+
```yaml
|
17 |
+
models:
|
18 |
+
- model: mistralai/Mistral-7B-v0.1
|
19 |
+
- model: Hastagaras/llama-3-8b-okay
|
20 |
+
- model: flammenai/Mahou-1.2-llama3-8B
|
21 |
+
merge_method: model_stock
|
22 |
+
base_model: mistralai/Mistral-7B-v0.1
|
23 |
+
dtype: bfloat16
|
24 |
+
```
|
25 |
+
|
26 |
+
## 💻 Usage
|
27 |
+
|
28 |
+
```python
|
29 |
+
!pip install -qU transformers accelerate
|
30 |
+
|
31 |
+
from transformers import AutoTokenizer
|
32 |
+
import transformers
|
33 |
+
import torch
|
34 |
+
|
35 |
+
model = "automerger/LlamaMahou-8B"
|
36 |
+
messages = [{"role": "user", "content": "What is a large language model?"}]
|
37 |
+
|
38 |
+
tokenizer = AutoTokenizer.from_pretrained(model)
|
39 |
+
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
40 |
+
pipeline = transformers.pipeline(
|
41 |
+
"text-generation",
|
42 |
+
model=model,
|
43 |
+
torch_dtype=torch.float16,
|
44 |
+
device_map="auto",
|
45 |
+
)
|
46 |
+
|
47 |
+
outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
|
48 |
+
print(outputs[0]["generated_text"])
|
49 |
+
```
|