Ramadhirra
commited on
Update README.md
Browse files
README.md
CHANGED
@@ -20,11 +20,48 @@ Foxglove_7B is a merge of the following models using [LazyMergekit](https://cola
|
|
20 |
* [ResplendentAI/Datura_7B](https://huggingface.co/ResplendentAI/Datura_7B)
|
21 |
* [Epiculous/Mika-7B](https://huggingface.co/Epiculous/Mika-7B)
|
22 |
|
23 |
-
## Configuration
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
* [ResplendentAI/Datura_7B](https://huggingface.co/ResplendentAI/Datura_7B)
|
21 |
* [Epiculous/Mika-7B](https://huggingface.co/Epiculous/Mika-7B)
|
22 |
|
23 |
+
## 🧩 Configuration
|
24 |
+
|
25 |
+
```yaml
|
26 |
+
slices:
|
27 |
+
- sources:
|
28 |
+
- model: ResplendentAI/Datura_7B
|
29 |
+
layer_range: [0, 32]
|
30 |
+
- model: Epiculous/Mika-7B
|
31 |
+
layer_range: [0, 32]
|
32 |
+
merge_method: slerp
|
33 |
+
base_model: ResplendentAI/Datura_7B
|
34 |
+
parameters:
|
35 |
+
t:
|
36 |
+
- filter: self_attn
|
37 |
+
value: [0, 0.7, 0.4, 0.6, 1]
|
38 |
+
- filter: mlp
|
39 |
+
value: [0.8, 0.5, 0.7, 0.3, 0]
|
40 |
+
- value: 0.6
|
41 |
+
dtype: bfloat16
|
42 |
+
```
|
43 |
+
|
44 |
+
## 💻 Usage
|
45 |
+
|
46 |
+
```python
|
47 |
+
!pip install -qU transformers accelerate
|
48 |
+
|
49 |
+
from transformers import AutoTokenizer
|
50 |
+
import transformers
|
51 |
+
import torch
|
52 |
+
|
53 |
+
model = "aridoverrun/Foxglove_7B"
|
54 |
+
messages = [{"role": "user", "content": "What is a large language model?"}]
|
55 |
+
|
56 |
+
tokenizer = AutoTokenizer.from_pretrained(model)
|
57 |
+
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
58 |
+
pipeline = transformers.pipeline(
|
59 |
+
"text-generation",
|
60 |
+
model=model,
|
61 |
+
torch_dtype=torch.float16,
|
62 |
+
device_map="auto",
|
63 |
+
)
|
64 |
+
|
65 |
+
outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
|
66 |
+
print(outputs[0]["generated_text"])
|
67 |
+
```
|