Upload folder using huggingface_hub
Browse files
README.md
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
base_model:
|
3 |
+
- fearlessdots/Llama-3-Alpha-Centauri-v0.1
|
4 |
+
- gradientai/Llama-3-8B-Instruct-Gradient-1048k
|
5 |
+
- abacusai/Llama-3-Smaug-8B
|
6 |
+
tags:
|
7 |
+
- merge
|
8 |
+
- mergekit
|
9 |
+
- lazymergekit
|
10 |
+
- fearlessdots/Llama-3-Alpha-Centauri-v0.1
|
11 |
+
- gradientai/Llama-3-8B-Instruct-Gradient-1048k
|
12 |
+
- abacusai/Llama-3-Smaug-8B
|
13 |
+
---
|
14 |
+
|
15 |
+
# Llama3-8B-Uncensored-1048k
|
16 |
+
|
17 |
+
Llama3-8B-Uncensored-1048k is a merge of the following models using [LazyMergekit](https://colab.research.google.com/drive/1obulZ1ROXHjYLn6PPZJwRR6GzgQogxxb?usp=sharing):
|
18 |
+
* [fearlessdots/Llama-3-Alpha-Centauri-v0.1](https://huggingface.co/fearlessdots/Llama-3-Alpha-Centauri-v0.1)
|
19 |
+
* [gradientai/Llama-3-8B-Instruct-Gradient-1048k](https://huggingface.co/gradientai/Llama-3-8B-Instruct-Gradient-1048k)
|
20 |
+
* [abacusai/Llama-3-Smaug-8B](https://huggingface.co/abacusai/Llama-3-Smaug-8B)
|
21 |
+
|
22 |
+
## 🧩 Configuration
|
23 |
+
|
24 |
+
```yaml
|
25 |
+
slices:
|
26 |
+
- sources:
|
27 |
+
- model: fearlessdots/Llama-3-Alpha-Centauri-v0.1
|
28 |
+
layer_range: [0, 32]
|
29 |
+
- model: gradientai/Llama-3-8B-Instruct-Gradient-1048k
|
30 |
+
layer_range: [0, 32]
|
31 |
+
- model: abacusai/Llama-3-Smaug-8B
|
32 |
+
layer_range: [0, 32]
|
33 |
+
merge_method: model_stock
|
34 |
+
base_model: fearlessdots/Llama-3-Alpha-Centauri-v0.1
|
35 |
+
parameters:
|
36 |
+
t:
|
37 |
+
- filter: self_attn
|
38 |
+
value: [0, 0.5, 0.3, 0.7, 1]
|
39 |
+
- filter: mlp
|
40 |
+
value: [1, 0.5, 0.7, 0.3, 0]
|
41 |
+
- value: 0.5
|
42 |
+
dtype: bfloat16
|
43 |
+
```
|
44 |
+
|
45 |
+
## 💻 Usage
|
46 |
+
|
47 |
+
```python
|
48 |
+
!pip install -qU transformers accelerate
|
49 |
+
|
50 |
+
from transformers import AutoTokenizer
|
51 |
+
import transformers
|
52 |
+
import torch
|
53 |
+
|
54 |
+
model = "td5038/Llama3-8B-Uncensored-1048k"
|
55 |
+
messages = [{"role": "user", "content": "What is a large language model?"}]
|
56 |
+
|
57 |
+
tokenizer = AutoTokenizer.from_pretrained(model)
|
58 |
+
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
59 |
+
pipeline = transformers.pipeline(
|
60 |
+
"text-generation",
|
61 |
+
model=model,
|
62 |
+
torch_dtype=torch.float16,
|
63 |
+
device_map="auto",
|
64 |
+
)
|
65 |
+
|
66 |
+
outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
|
67 |
+
print(outputs[0]["generated_text"])
|
68 |
+
```
|