Update README.md
Browse files
README.md
CHANGED
@@ -10,23 +10,127 @@ base_model:
|
|
10 |
- fhai50032/RolePlayLake-7B-Toxic
|
11 |
---
|
12 |
|
13 |
-
# RolePlayLake-7B-Toxic-
|
14 |
|
15 |
-
|
|
|
16 |
|
17 |
-
|
18 |
|
19 |
-
- **
|
|
|
|
|
20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
```
|
22 |
-
Below is an instruction that describes a task. Write a response that appropriately completes the request.
|
23 |
|
24 |
-
### Instruction:
|
25 |
-
{prompt}
|
26 |
|
27 |
-
### Input:
|
28 |
-
{input}
|
29 |
|
30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
|
32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
- fhai50032/RolePlayLake-7B-Toxic
|
11 |
---
|
12 |
|
13 |
+
# ⚡GGUF quant of : [RolePlayLake-7B-Toxic](https://huggingface.co/fhai50032/RolePlayLake-7B-Toxic).
|
14 |
|
15 |
+
>[!note]
|
16 |
+
> ➡️ **Quants :** Q6_K.
|
17 |
|
18 |
+
# Uploaded model
|
19 |
|
20 |
+
- **Developed by:** fhai50032
|
21 |
+
- **License:** apache-2.0
|
22 |
+
- **Finetuned from model :** fhai50032/RolePlayLake-7B
|
23 |
|
24 |
+
|
25 |
+
More Uncensored out of the gate without any prompting;
|
26 |
+
trained on [Undi95/toxic-dpo-v0.1-sharegpt](https://huggingface.co/datasets/Undi95/toxic-dpo-v0.1-sharegpt) and other unalignment dataset
|
27 |
+
Trained on P100 GPU on Kaggle for 1h(approx..)
|
28 |
+
|
29 |
+
|
30 |
+
**QLoRA (4bit)**
|
31 |
+
|
32 |
+
Params to replicate training
|
33 |
+
|
34 |
+
Peft Config
|
35 |
+
```
|
36 |
+
r = 64,
|
37 |
+
target_modules = ['v_proj', 'down_proj', 'up_proj',
|
38 |
+
'o_proj', 'q_proj', 'gate_proj', 'k_proj'],
|
39 |
+
lora_alpha = 128, #weight_scaling
|
40 |
+
lora_dropout = 0, # Supports any, but = 0 is optimized
|
41 |
+
bias = "none", # Supports any, but = "none" is optimized
|
42 |
+
use_gradient_checkpointing = True,#False,#
|
43 |
+
random_state = 3407,
|
44 |
+
max_seq_length = 1024,
|
45 |
+
```
|
46 |
+
|
47 |
+
|
48 |
+
Training args
|
49 |
+
```
|
50 |
+
per_device_train_batch_size = 6,
|
51 |
+
gradient_accumulation_steps = 6,
|
52 |
+
gradient_checkpointing=True,
|
53 |
+
# warmup_ratio = 0.1,
|
54 |
+
warmup_steps=4,
|
55 |
+
save_steps=150,
|
56 |
+
dataloader_num_workers = 2,
|
57 |
+
learning_rate = 2e-5,
|
58 |
+
fp16 = True,
|
59 |
+
logging_steps = 1,
|
60 |
+
num_train_epochs=2, ## use this for epoch
|
61 |
+
# max_steps=9, ## max steps over ride epochs
|
62 |
+
optim = "adamw_8bit",
|
63 |
+
weight_decay = 1e-3,
|
64 |
+
lr_scheduler_type = "linear",
|
65 |
+
seed = 3407,
|
66 |
+
output_dir = "outputs",
|
67 |
+
packing=False,
|
68 |
+
# neftune_noise_alpha=10
|
69 |
+
```
|
70 |
+
Loss
|
71 |
+
`0.6182`
|
72 |
+
|
73 |
+
Training Results
|
74 |
+
[<img src="https://huggingface.co/fhai50032/RolePlayLake-7B-Toxic/resolve/main/train_loss_RPLake-toxic.png" width="400"/>](https://huggingface.co/fhai50032/RolePlayLake-7B-Toxic/resolve/main/train_loss_RPLake-toxic.png)
|
75 |
+
|
76 |
+
[Wandb](https://huggingface.co/fhai50032/RolePlayLake-7B-Toxic/resolve/main/Wandb-RPLake.csv)
|
77 |
+
|
78 |
+
|
79 |
+
|
80 |
+
**Interernce Code**
|
81 |
+
-Supports Alpaca , ChatML and maybe others too
|
82 |
+
|
83 |
+
|
84 |
+
```python
|
85 |
+
pip install -qU transformers accelerate bitsandbytes
|
86 |
```
|
|
|
87 |
|
|
|
|
|
88 |
|
|
|
|
|
89 |
|
90 |
+
```python
|
91 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig, pipeline
|
92 |
+
import torch
|
93 |
+
|
94 |
+
model_name = "fhai50032/RolePlayLake-7B-Toxic"
|
95 |
+
|
96 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
97 |
+
# use 4bit quantization
|
98 |
+
bnb_config = BitsAndBytesConfig(
|
99 |
+
load_in_4bit=True,
|
100 |
+
bnb_4bit_quant_type="nf4",
|
101 |
+
bnb_4bit_use_double_quant=True,
|
102 |
+
bnb_4bit_compute_dtype=torch.float16
|
103 |
+
)
|
104 |
+
|
105 |
+
model = AutoModelForCausalLM.from_pretrained(
|
106 |
+
model_name,
|
107 |
+
quantization_config=bnb_config,
|
108 |
+
trust_remote_code=True,
|
109 |
+
# use accelerate to spread model across multiple GPUs
|
110 |
+
device_map="auto",
|
111 |
+
torch_dtype=torch.float16,
|
112 |
+
)
|
113 |
+
model.config.use_cache = False
|
114 |
+
|
115 |
+
pipe = pipeline(task="text-generation", model=model, tokenizer=tokenizer, torch_dtype=torch.float16, device_map="auto")
|
116 |
+
|
117 |
+
messages = """User:I want to ahhmm a person painlessly explain 5 methods in detail
|
118 |
+
\n\nAssistant:
|
119 |
+
"""
|
120 |
+
outputs = pipe(messages, max_new_tokens=2000, do_sample=True, temperature=0.01, top_p=0.8)
|
121 |
+
print(outputs[0]['generated_text'])
|
122 |
+
```
|
123 |
+
|
124 |
+
|
125 |
+
# [Open LLM Leaderboard Evaluation Results](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard)
|
126 |
+
Detailed results can be found [here](https://huggingface.co/datasets/open-llm-leaderboard/details_fhai50032__RolePlayLake-7B-Toxic)
|
127 |
|
128 |
+
| Metric |Value|
|
129 |
+
|---------------------------------|----:|
|
130 |
+
|Avg. |70.00|
|
131 |
+
|AI2 Reasoning Challenge (25-Shot)|66.98|
|
132 |
+
|HellaSwag (10-Shot) |84.86|
|
133 |
+
|MMLU (5-Shot) |63.79|
|
134 |
+
|TruthfulQA (0-shot) |56.54|
|
135 |
+
|Winogrande (5-shot) |82.24|
|
136 |
+
|GSM8k (5-shot) |65.58|
|