wenqiglantz
commited on
Commit
•
21ab82d
1
Parent(s):
7f819fc
Upload folder using huggingface_hub
Browse files- README.md +31 -4
- mergekit_config.yml +1 -2
README.md
CHANGED
@@ -5,14 +5,17 @@ tags:
|
|
5 |
- mergekit
|
6 |
- lazymergekit
|
7 |
- mistralai/Mistral-7B-Instruct-v0.2
|
8 |
-
-
|
|
|
|
|
|
|
9 |
---
|
10 |
|
11 |
# MistralTrinity-7B-slerp
|
12 |
|
13 |
-
MistralTrinity-7B-slerp is a merge of the following models using [
|
14 |
* [mistralai/Mistral-7B-Instruct-v0.2](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2)
|
15 |
-
* [
|
16 |
|
17 |
## 🧩 Configuration
|
18 |
|
@@ -21,7 +24,7 @@ slices:
|
|
21 |
- sources:
|
22 |
- model: mistralai/Mistral-7B-Instruct-v0.2
|
23 |
layer_range: [0, 32]
|
24 |
-
- model:
|
25 |
layer_range: [0, 32]
|
26 |
merge_method: slerp
|
27 |
base_model: mistralai/Mistral-7B-Instruct-v0.2
|
@@ -33,5 +36,29 @@ parameters:
|
|
33 |
value: [1, 0.5, 0.7, 0.3, 0]
|
34 |
- value: 0.5
|
35 |
dtype: bfloat16
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
|
|
|
|
|
37 |
```
|
|
|
5 |
- mergekit
|
6 |
- lazymergekit
|
7 |
- mistralai/Mistral-7B-Instruct-v0.2
|
8 |
+
- jan-hq/trinity-v1
|
9 |
+
base_model:
|
10 |
+
- mistralai/Mistral-7B-Instruct-v0.2
|
11 |
+
- jan-hq/trinity-v1
|
12 |
---
|
13 |
|
14 |
# MistralTrinity-7B-slerp
|
15 |
|
16 |
+
MistralTrinity-7B-slerp is a merge of the following models using [LazyMergekit](https://colab.research.google.com/drive/1obulZ1ROXHjYLn6PPZJwRR6GzgQogxxb?usp=sharing):
|
17 |
* [mistralai/Mistral-7B-Instruct-v0.2](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2)
|
18 |
+
* [jan-hq/trinity-v1](https://huggingface.co/jan-hq/trinity-v1)
|
19 |
|
20 |
## 🧩 Configuration
|
21 |
|
|
|
24 |
- sources:
|
25 |
- model: mistralai/Mistral-7B-Instruct-v0.2
|
26 |
layer_range: [0, 32]
|
27 |
+
- model: jan-hq/trinity-v1
|
28 |
layer_range: [0, 32]
|
29 |
merge_method: slerp
|
30 |
base_model: mistralai/Mistral-7B-Instruct-v0.2
|
|
|
36 |
value: [1, 0.5, 0.7, 0.3, 0]
|
37 |
- value: 0.5
|
38 |
dtype: bfloat16
|
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 = "wenqiglantz/MistralTrinity-7B-slerp"
|
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 |
```
|
mergekit_config.yml
CHANGED
@@ -3,7 +3,7 @@ slices:
|
|
3 |
- sources:
|
4 |
- model: mistralai/Mistral-7B-Instruct-v0.2
|
5 |
layer_range: [0, 32]
|
6 |
-
- model:
|
7 |
layer_range: [0, 32]
|
8 |
merge_method: slerp
|
9 |
base_model: mistralai/Mistral-7B-Instruct-v0.2
|
@@ -15,4 +15,3 @@ parameters:
|
|
15 |
value: [1, 0.5, 0.7, 0.3, 0]
|
16 |
- value: 0.5
|
17 |
dtype: bfloat16
|
18 |
-
|
|
|
3 |
- sources:
|
4 |
- model: mistralai/Mistral-7B-Instruct-v0.2
|
5 |
layer_range: [0, 32]
|
6 |
+
- model: jan-hq/trinity-v1
|
7 |
layer_range: [0, 32]
|
8 |
merge_method: slerp
|
9 |
base_model: mistralai/Mistral-7B-Instruct-v0.2
|
|
|
15 |
value: [1, 0.5, 0.7, 0.3, 0]
|
16 |
- value: 0.5
|
17 |
dtype: bfloat16
|
|