玩模型开放模型 · 清晰来源 · 自主选择
返回模型目录
cgus /

Qwen2-7B-Instruct-abliterated-exl2

HF 源站

cgus/Qwen2-7B-Instruct-abliterated-exl2 is an uncensored open-source model hosted on Hugging Face.

Text GenerationEnglishLicense: apache-2.07Btransformersqwen2chatconversational4-bitexl2
README.md说明 / 使用方法

license: apache-2.0 language:

  • en pipeline_tag: text-generation base_model: natong19/Qwen2-7B-Instruct-abliterated inference: false tags:
  • chat

Qwen2-7B-Instruct-abliterated-exl2

Model: Qwen2-7B-Instruct-abliterated
Made by: natong19

Based on original model: Qwen2-7B-Instruct
Created by: Qwen

QuantVRAM/4kVRAM/8kVRAM/16kVRAM/32k
4bpw h6 (main)5.3GB5.6GB5.9GB6.8GB
4.25bpw h65.5GB5.8GB6.2GB7.1GB
4.65bpw h65.8GB6.1GB6.5GB7.3GB
5bpw h66GB6.4GB6.7GB7.7GB
6bpw h66.8GB7.2GB7.5GB8.4GB
8bpw h88.2GB8.6GB8.9GB9.8GB

Quantization notes

Made with Exllamav2 0.1.5 and the default dataset.
Doesn't seem to work with 4 or 8bit cache with Exllamav2-0.1.5, maybe it could change in the future.
I'm quite impressed with its ability to process a non-English text at 32k context with usable results with my 12GB GPU, with 8bpw precision at that.

How to run

This quantization uses GPU and requires Exllamav2 loader, model files have to be fully loaded in VRAM to work.
It should work well either with Nvidia RTX cards on Windows/Linux or AMD on Linux. For other hardware it's better to use GGUF models instead.
This model can be loaded with in following applications:
Text Generation Webui
KoboldAI
ExUI, etc.

Original model card

Qwen2-7B-Instruct-abliterated

Introduction

Abliterated version of Qwen2-7B-Instruct using failspy's notebook. The model's strongest refusal directions have been ablated via weight orthogonalization, but the model may still refuse your request, misunderstand your intent, or provide unsolicited advice regarding ethics or safety.

Quickstart

from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "natong19/Qwen2-7B-Instruct-abliterated"
device = "cuda" # the device to load the model onto

model = AutoModelForCausalLM.from_pretrained(
    model_id,
    torch_dtype="auto",
    device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained(model_id)

prompt = "Give me a short introduction to large language model."
messages = [
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt").to(device)

generated_ids = model.generate(
    model_inputs.input_ids,
    max_new_tokens=256
)
generated_ids = [
    output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]

response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(response)

Evaluation

Evaluation framework: lm-evaluation-harness 0.4.2

DatasetsQwen2-7B-InstructQwen2-7B-Instruct-abliterated
ARC (25-shot)62.562.5
GSM8K (5-shot)73.072.2
HellaSwag (10-shot)81.881.7
MMLU (5-shot)70.770.5
TruthfulQA (0-shot)57.355.0
Winogrande (5-shot)76.277.4
HUGGING FACE

上游数据

HF 下载量17
HF 点赞量0

HF 下载量为源站最近 30 天统计,与本站点击分开。

SITE STATS

本站统计

下载点击—
请求数—
匿名去重—最近 7 天—

本站下载量记录按钮点击,不代表下载完成;短时连点会去重。

来源与版本

作者
cgus
最近更新
2024/06/24
最新创建
2024/06/15
HF 趋势
未知
数据快照
2026/09/16
版本
未知
许可证
apache-2.0