Upload folder using huggingface_hub
Browse files
README.md
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
tags:
|
3 |
+
- merge
|
4 |
+
- mergekit
|
5 |
+
- lazymergekit
|
6 |
+
---
|
7 |
+
|
8 |
+
# Mergerix-7b-v0.2
|
9 |
+
|
10 |
+
Mergerix-7b-v0.2 is a merge of the following models using [LazyMergekit](https://colab.research.google.com/drive/1obulZ1ROXHjYLn6PPZJwRR6GzgQogxxb?usp=sharing):
|
11 |
+
|
12 |
+
## 🧩 Configuration
|
13 |
+
|
14 |
+
```yaml
|
15 |
+
models:
|
16 |
+
- model: alpindale/Mistral-7B-v0.2-hf
|
17 |
+
- model: liminerity/M7-7b
|
18 |
+
- model: rwitz/experiment26-truthy-iter-0
|
19 |
+
merge_method: model_stock
|
20 |
+
base_model: alpindale/Mistral-7B-v0.2-hf
|
21 |
+
dtype: bfloat16
|
22 |
+
```
|
23 |
+
|
24 |
+
## 💻 Usage
|
25 |
+
|
26 |
+
```python
|
27 |
+
!pip install -qU transformers accelerate
|
28 |
+
|
29 |
+
from transformers import AutoTokenizer
|
30 |
+
import transformers
|
31 |
+
import torch
|
32 |
+
|
33 |
+
model = "MiniMoog/Mergerix-7b-v0.2"
|
34 |
+
messages = [{"role": "user", "content": "What is a large language model?"}]
|
35 |
+
|
36 |
+
tokenizer = AutoTokenizer.from_pretrained(model)
|
37 |
+
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
38 |
+
pipeline = transformers.pipeline(
|
39 |
+
"text-generation",
|
40 |
+
model=model,
|
41 |
+
torch_dtype=torch.float16,
|
42 |
+
device_map="auto",
|
43 |
+
)
|
44 |
+
|
45 |
+
outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
|
46 |
+
print(outputs[0]["generated_text"])
|
47 |
+
```
|