RichardErkhov
commited on
Commit
•
2004d94
1
Parent(s):
21cc0f1
uploaded readme
Browse files
README.md
ADDED
@@ -0,0 +1,151 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Quantization made by Richard Erkhov.
|
2 |
+
|
3 |
+
[Github](https://github.com/RichardErkhov)
|
4 |
+
|
5 |
+
[Discord](https://discord.gg/pvy7H8DZMG)
|
6 |
+
|
7 |
+
[Request more models](https://github.com/RichardErkhov/quant_request)
|
8 |
+
|
9 |
+
|
10 |
+
Qwen2.5-7B-Instruct-abliterated-v3 - GGUF
|
11 |
+
- Model creator: https://huggingface.co/huihui-ai/
|
12 |
+
- Original model: https://huggingface.co/huihui-ai/Qwen2.5-7B-Instruct-abliterated-v3/
|
13 |
+
|
14 |
+
|
15 |
+
| Name | Quant method | Size |
|
16 |
+
| ---- | ---- | ---- |
|
17 |
+
| [Qwen2.5-7B-Instruct-abliterated-v3.Q2_K.gguf](https://huggingface.co/RichardErkhov/huihui-ai_-_Qwen2.5-7B-Instruct-abliterated-v3-gguf/blob/main/Qwen2.5-7B-Instruct-abliterated-v3.Q2_K.gguf) | Q2_K | 2.81GB |
|
18 |
+
| [Qwen2.5-7B-Instruct-abliterated-v3.Q3_K_S.gguf](https://huggingface.co/RichardErkhov/huihui-ai_-_Qwen2.5-7B-Instruct-abliterated-v3-gguf/blob/main/Qwen2.5-7B-Instruct-abliterated-v3.Q3_K_S.gguf) | Q3_K_S | 3.25GB |
|
19 |
+
| [Qwen2.5-7B-Instruct-abliterated-v3.Q3_K.gguf](https://huggingface.co/RichardErkhov/huihui-ai_-_Qwen2.5-7B-Instruct-abliterated-v3-gguf/blob/main/Qwen2.5-7B-Instruct-abliterated-v3.Q3_K.gguf) | Q3_K | 3.55GB |
|
20 |
+
| [Qwen2.5-7B-Instruct-abliterated-v3.Q3_K_M.gguf](https://huggingface.co/RichardErkhov/huihui-ai_-_Qwen2.5-7B-Instruct-abliterated-v3-gguf/blob/main/Qwen2.5-7B-Instruct-abliterated-v3.Q3_K_M.gguf) | Q3_K_M | 3.55GB |
|
21 |
+
| [Qwen2.5-7B-Instruct-abliterated-v3.Q3_K_L.gguf](https://huggingface.co/RichardErkhov/huihui-ai_-_Qwen2.5-7B-Instruct-abliterated-v3-gguf/blob/main/Qwen2.5-7B-Instruct-abliterated-v3.Q3_K_L.gguf) | Q3_K_L | 3.81GB |
|
22 |
+
| [Qwen2.5-7B-Instruct-abliterated-v3.IQ4_XS.gguf](https://huggingface.co/RichardErkhov/huihui-ai_-_Qwen2.5-7B-Instruct-abliterated-v3-gguf/blob/main/Qwen2.5-7B-Instruct-abliterated-v3.IQ4_XS.gguf) | IQ4_XS | 3.96GB |
|
23 |
+
| [Qwen2.5-7B-Instruct-abliterated-v3.Q4_0.gguf](https://huggingface.co/RichardErkhov/huihui-ai_-_Qwen2.5-7B-Instruct-abliterated-v3-gguf/blob/main/Qwen2.5-7B-Instruct-abliterated-v3.Q4_0.gguf) | Q4_0 | 4.13GB |
|
24 |
+
| [Qwen2.5-7B-Instruct-abliterated-v3.IQ4_NL.gguf](https://huggingface.co/RichardErkhov/huihui-ai_-_Qwen2.5-7B-Instruct-abliterated-v3-gguf/blob/main/Qwen2.5-7B-Instruct-abliterated-v3.IQ4_NL.gguf) | IQ4_NL | 4.16GB |
|
25 |
+
| [Qwen2.5-7B-Instruct-abliterated-v3.Q4_K_S.gguf](https://huggingface.co/RichardErkhov/huihui-ai_-_Qwen2.5-7B-Instruct-abliterated-v3-gguf/blob/main/Qwen2.5-7B-Instruct-abliterated-v3.Q4_K_S.gguf) | Q4_K_S | 4.15GB |
|
26 |
+
| [Qwen2.5-7B-Instruct-abliterated-v3.Q4_K.gguf](https://huggingface.co/RichardErkhov/huihui-ai_-_Qwen2.5-7B-Instruct-abliterated-v3-gguf/blob/main/Qwen2.5-7B-Instruct-abliterated-v3.Q4_K.gguf) | Q4_K | 4.36GB |
|
27 |
+
| [Qwen2.5-7B-Instruct-abliterated-v3.Q4_K_M.gguf](https://huggingface.co/RichardErkhov/huihui-ai_-_Qwen2.5-7B-Instruct-abliterated-v3-gguf/blob/main/Qwen2.5-7B-Instruct-abliterated-v3.Q4_K_M.gguf) | Q4_K_M | 4.36GB |
|
28 |
+
| [Qwen2.5-7B-Instruct-abliterated-v3.Q4_1.gguf](https://huggingface.co/RichardErkhov/huihui-ai_-_Qwen2.5-7B-Instruct-abliterated-v3-gguf/blob/main/Qwen2.5-7B-Instruct-abliterated-v3.Q4_1.gguf) | Q4_1 | 4.54GB |
|
29 |
+
| [Qwen2.5-7B-Instruct-abliterated-v3.Q5_0.gguf](https://huggingface.co/RichardErkhov/huihui-ai_-_Qwen2.5-7B-Instruct-abliterated-v3-gguf/blob/main/Qwen2.5-7B-Instruct-abliterated-v3.Q5_0.gguf) | Q5_0 | 4.95GB |
|
30 |
+
| [Qwen2.5-7B-Instruct-abliterated-v3.Q5_K_S.gguf](https://huggingface.co/RichardErkhov/huihui-ai_-_Qwen2.5-7B-Instruct-abliterated-v3-gguf/blob/main/Qwen2.5-7B-Instruct-abliterated-v3.Q5_K_S.gguf) | Q5_K_S | 4.95GB |
|
31 |
+
| [Qwen2.5-7B-Instruct-abliterated-v3.Q5_K.gguf](https://huggingface.co/RichardErkhov/huihui-ai_-_Qwen2.5-7B-Instruct-abliterated-v3-gguf/blob/main/Qwen2.5-7B-Instruct-abliterated-v3.Q5_K.gguf) | Q5_K | 5.07GB |
|
32 |
+
| [Qwen2.5-7B-Instruct-abliterated-v3.Q5_K_M.gguf](https://huggingface.co/RichardErkhov/huihui-ai_-_Qwen2.5-7B-Instruct-abliterated-v3-gguf/blob/main/Qwen2.5-7B-Instruct-abliterated-v3.Q5_K_M.gguf) | Q5_K_M | 5.07GB |
|
33 |
+
| [Qwen2.5-7B-Instruct-abliterated-v3.Q5_1.gguf](https://huggingface.co/RichardErkhov/huihui-ai_-_Qwen2.5-7B-Instruct-abliterated-v3-gguf/blob/main/Qwen2.5-7B-Instruct-abliterated-v3.Q5_1.gguf) | Q5_1 | 5.36GB |
|
34 |
+
| [Qwen2.5-7B-Instruct-abliterated-v3.Q6_K.gguf](https://huggingface.co/RichardErkhov/huihui-ai_-_Qwen2.5-7B-Instruct-abliterated-v3-gguf/blob/main/Qwen2.5-7B-Instruct-abliterated-v3.Q6_K.gguf) | Q6_K | 5.82GB |
|
35 |
+
| [Qwen2.5-7B-Instruct-abliterated-v3.Q8_0.gguf](https://huggingface.co/RichardErkhov/huihui-ai_-_Qwen2.5-7B-Instruct-abliterated-v3-gguf/blob/main/Qwen2.5-7B-Instruct-abliterated-v3.Q8_0.gguf) | Q8_0 | 7.54GB |
|
36 |
+
|
37 |
+
|
38 |
+
|
39 |
+
|
40 |
+
Original model description:
|
41 |
+
---
|
42 |
+
library_name: transformers
|
43 |
+
license: apache-2.0
|
44 |
+
license_link: https://huggingface.co/huihui-ai/Qwen2.5-7B-Instruct-abliterated-v3/blob/main/LICENSE
|
45 |
+
language:
|
46 |
+
- en
|
47 |
+
pipeline_tag: text-generation
|
48 |
+
base_model: Qwen/Qwen2.5-7B-Instruct
|
49 |
+
tags:
|
50 |
+
- chat
|
51 |
+
- abliterated
|
52 |
+
- uncensored
|
53 |
+
---
|
54 |
+
|
55 |
+
# huihui-ai/Qwen2.5-7B-Instruct-abliterated-v3
|
56 |
+
|
57 |
+
|
58 |
+
This is an uncensored version of [Qwen/Qwen2.5-7B-Instruct](https://huggingface.co/Qwen/Qwen2.5-7B-Instruct) created with abliteration (see [remove-refusals-with-transformers](https://github.com/Sumandora/remove-refusals-with-transformers) to know more about it).
|
59 |
+
This is a crude, proof-of-concept implementation to remove refusals from an LLM model without using TransformerLens.
|
60 |
+
The test results are not very good, but compared to before, there is much less [garbled text](https://huggingface.co/huihui-ai/Qwen2.5-7B-Instruct-abliterated-v2/discussions/2).
|
61 |
+
|
62 |
+
## Usage
|
63 |
+
You can use this model in your applications by loading it with Hugging Face's `transformers` library:
|
64 |
+
|
65 |
+
|
66 |
+
```python
|
67 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
68 |
+
|
69 |
+
# Load the model and tokenizer
|
70 |
+
model_name = "huihui-ai/Qwen2.5-7B-Instruct-abliterated-v3"
|
71 |
+
model = AutoModelForCausalLM.from_pretrained(
|
72 |
+
model_name,
|
73 |
+
torch_dtype="auto",
|
74 |
+
device_map="auto"
|
75 |
+
)
|
76 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
77 |
+
|
78 |
+
# Initialize conversation context
|
79 |
+
initial_messages = [
|
80 |
+
{"role": "system", "content": "You are Qwen, created by Alibaba Cloud. You are a helpful assistant."}
|
81 |
+
]
|
82 |
+
messages = initial_messages.copy() # Copy the initial conversation context
|
83 |
+
|
84 |
+
# Enter conversation loop
|
85 |
+
while True:
|
86 |
+
# Get user input
|
87 |
+
user_input = input("User: ").strip() # Strip leading and trailing spaces
|
88 |
+
|
89 |
+
# If the user types '/exit', end the conversation
|
90 |
+
if user_input.lower() == "/exit":
|
91 |
+
print("Exiting chat.")
|
92 |
+
break
|
93 |
+
|
94 |
+
# If the user types '/clean', reset the conversation context
|
95 |
+
if user_input.lower() == "/clean":
|
96 |
+
messages = initial_messages.copy() # Reset conversation context
|
97 |
+
print("Chat history cleared. Starting a new conversation.")
|
98 |
+
continue
|
99 |
+
|
100 |
+
# If input is empty, prompt the user and continue
|
101 |
+
if not user_input:
|
102 |
+
print("Input cannot be empty. Please enter something.")
|
103 |
+
continue
|
104 |
+
|
105 |
+
# Add user input to the conversation
|
106 |
+
messages.append({"role": "user", "content": user_input})
|
107 |
+
|
108 |
+
# Build the chat template
|
109 |
+
text = tokenizer.apply_chat_template(
|
110 |
+
messages,
|
111 |
+
tokenize=False,
|
112 |
+
add_generation_prompt=True
|
113 |
+
)
|
114 |
+
|
115 |
+
# Tokenize input and prepare it for the model
|
116 |
+
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
|
117 |
+
|
118 |
+
# Generate a response from the model
|
119 |
+
generated_ids = model.generate(
|
120 |
+
**model_inputs,
|
121 |
+
max_new_tokens=8192
|
122 |
+
)
|
123 |
+
|
124 |
+
# Extract model output, removing special tokens
|
125 |
+
generated_ids = [
|
126 |
+
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
|
127 |
+
]
|
128 |
+
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
129 |
+
|
130 |
+
# Add the model's response to the conversation
|
131 |
+
messages.append({"role": "assistant", "content": response})
|
132 |
+
|
133 |
+
# Print the model's response
|
134 |
+
print(f"Qwen: {response}")
|
135 |
+
|
136 |
+
```
|
137 |
+
|
138 |
+
## Evaluations
|
139 |
+
The following data has been re-evaluated and calculated as the average for each test.
|
140 |
+
|
141 |
+
| Benchmark | Qwen2.5-7B-Instruct | Qwen2.5-7B-Instruct-abliterated-v3 | Qwen2.5-7B-Instruct-abliterated-v2 | Qwen2.5-7B-Instruct-abliterated |
|
142 |
+
|-------------|---------------------|------------------------------------|------------------------------------|---------------------------------|
|
143 |
+
| IF_Eval | 76.44 | 72.64 | **77.82** | 76.49 |
|
144 |
+
| MMLU Pro | **43.12** | 39.14 | 42.03 | 41.71 |
|
145 |
+
| TruthfulQA | 62.46 | 57.27 | 57.81 | **64.92** |
|
146 |
+
| BBH | **53.92** | 50.67 | 53.01 | 52.77 |
|
147 |
+
| GPQA | 31.91 | 31.65 | **32.17** | 31.97 |
|
148 |
+
|
149 |
+
The script used for evaluation can be found inside this repository under /eval.sh, or click [here](https://huggingface.co/huihui-ai/Qwen2.5-7B-Instruct-abliterated-v3/blob/main/eval.sh)
|
150 |
+
|
151 |
+
|