gauthamk28
commited on
Commit
•
4fc4b23
1
Parent(s):
1a20e04
Upload folder using huggingface_hub
Browse files
README.md
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
tags:
|
4 |
+
- merge
|
5 |
+
- mergekit
|
6 |
+
- lazymergekit
|
7 |
+
- cognitivecomputations/dolphin-2.6-mistral-7b
|
8 |
+
- Open-Orca/Mistral-7B-OpenOrca
|
9 |
+
---
|
10 |
+
|
11 |
+
# doltral-7B-ties
|
12 |
+
|
13 |
+
doltral-7B-ties is a merge of the following models using [LazyMergekit](https://colab.research.google.com/drive/1obulZ1ROXHjYLn6PPZJwRR6GzgQogxxb?usp=sharing):
|
14 |
+
* [cognitivecomputations/dolphin-2.6-mistral-7b](https://huggingface.co/cognitivecomputations/dolphin-2.6-mistral-7b)
|
15 |
+
* [Open-Orca/Mistral-7B-OpenOrca](https://huggingface.co/Open-Orca/Mistral-7B-OpenOrca)
|
16 |
+
|
17 |
+
## 🧩 Configuration
|
18 |
+
|
19 |
+
```yaml
|
20 |
+
models:
|
21 |
+
- model: mistralai/Mistral-7B-v0.1
|
22 |
+
# no parameters necessary for base model
|
23 |
+
- model: cognitivecomputations/dolphin-2.6-mistral-7b
|
24 |
+
parameters:
|
25 |
+
density: 0.5
|
26 |
+
weight: 0.5
|
27 |
+
- model: Open-Orca/Mistral-7B-OpenOrca
|
28 |
+
parameters:
|
29 |
+
density: 0.5
|
30 |
+
weight: 0.3
|
31 |
+
merge_method: ties
|
32 |
+
base_model: mistralai/Mistral-7B-v0.1
|
33 |
+
parameters:
|
34 |
+
normalize: true
|
35 |
+
dtype: float16
|
36 |
+
```
|
37 |
+
|
38 |
+
## 💻 Usage
|
39 |
+
|
40 |
+
```python
|
41 |
+
!pip install -qU transformers accelerate
|
42 |
+
|
43 |
+
from transformers import AutoTokenizer
|
44 |
+
import transformers
|
45 |
+
import torch
|
46 |
+
|
47 |
+
model = "gauthamk28/doltral-7B-ties"
|
48 |
+
messages = [{"role": "user", "content": "What is a large language model?"}]
|
49 |
+
|
50 |
+
tokenizer = AutoTokenizer.from_pretrained(model)
|
51 |
+
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
52 |
+
pipeline = transformers.pipeline(
|
53 |
+
"text-generation",
|
54 |
+
model=model,
|
55 |
+
torch_dtype=torch.float16,
|
56 |
+
device_map="auto",
|
57 |
+
)
|
58 |
+
|
59 |
+
outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
|
60 |
+
print(outputs[0]["generated_text"])
|
61 |
+
```
|