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

Qwen3-8B-Abliterated-NF4

HF 源站

ikarius/Qwen3-8B-Abliterated-NF4 is an uncensored open-source model hosted on Hugging Face.

Text GenerationsafetensorsEnglishLicense: apache-2.08Btransformersqwen3qwenabliterationuncensorednf4quantized4-bitconversationaltext-generation-inferencebitsandbytes
README.md说明 / 使用方法

language:

  • en license: apache-2.0 library_name: transformers pipeline_tag: text-generation tags:
  • qwen
  • abliteration
  • uncensored
  • nf4
  • quantized
  • 8b
  • 4-bit base_model:
  • Qwen/Qwen3-8B widget:
  • example_title: Example example_inputs: Hello, how are you? model-index:
  • name: Qwen3-8B-Abliterated-v2-nf4 results: [] derived_from: huihui-ai/Huihui-Qwen3-8B-abliterated-v2

Qwen3-14B-Abliterated-v2-nf4

Model Overview

This repository contains a quantized version (NF4, using BitsAndBytes) of the Qwen3-8B-Abliterated-v2 model.
The original model is an uncensored variant of Qwen/Qwen3-8B, created using the abliteration technique to remove refusal behaviors (see remove-refusals-with-transformers).

This quantization was performed by ikarius to reduce model size and enable efficient inference on consumer hardware, while preserving the uncensored capabilities of the base model.

Key Features:

  • Base Model: Qwen3-8B (abliterated for uncensoring)
  • Version: Abliterated-v2 (improved over v1)
  • Quantization: NF4 (4-bit NormalFloat via BitsAndBytes)
  • Parameters: 8 Billion
  • License: Refer to the original Qwen3 license (Apache 2.0 with additional terms); abliteration does not alter the license.
  • Intended Use: Research, experimentation, and creative applications.

    Warning: This model is uncensored and may generate sensitive or harmful content—use responsibly.


Installation

  1. Install the required dependencies:
    pip install transformers torch bitsandbytes accelerate
    

Ensure you have a compatible CUDA setup for GPU acceleration.

(Optional) For CPU-only inference:bash

pip install optimum[exporters]

Usage

Load and run the model using Hugging Face Transformers.

Python Example


from transformers import AutoModelForCausalLM, AutoTokenizer
import torch

# Load tokenizer and model
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
model = AutoModelForCausalLM.from_pretrained(
    MODEL_ID,
    device_map="auto",
    trust_remote_code=True,
)

Example inference

prompt = "Hello, how are you?"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(
    **inputs,
    max_new_tokens=128,
    temperature=0.7,
    do_sample=True,
    pad_token_id=tokenizer.eos_token_id,
)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)

Inference Tips

VRAM: ~8 GB required for 8B NF4 on a single GPU. Batch Size: Start with 1. Thinking Mode: v2 supports step-by-step reasoning prompts. Streaming: Use TextStreamer for real-time output.

Quantization Details

Method: BitsAndBytes NF4 (normal float 4-bit) Quantizer: ikarius Benefits: ~75% size reduction vs BF16, minimal quality loss Trade-offs: Slight perplexity increase

Reproduce Quantization

from transformers import AutoModelForCausalLM, BitsAndBytesConfig
import torch

original_model = AutoModelForCausalLM.from_pretrained(
    "huihui-ai/Huihui-Qwen3-8B-abliterated-v2",
    torch_dtype=torch.bfloat16,
    device_map="auto",
)

quant_config = BitsAndBytesConfig(
    load_in_4bit=True,
    bnb_4bit_quant_type="nf4",
    bnb_4bit_compute_dtype=torch.bfloat16,
    bnb_4bit_use_double_quant=True,
)

quantized_model = AutoModelForCausalLM.from_pretrained(
    "huihui-ai/Huihui-Qwen3-8B-abliterated-v2",
    quantization_config=quant_config,
    device_map="auto",
)

quantized_model.save_pretrained("Qwen3-8B-Abliterated-v2-nf4")
tokenizer.save_pretrained("Qwen3-8B-Abliterated-v2-nf4")

Limitations & Ethics

May amplify training data biases. Not suitable for production without alignment. For commercial use: review original licenses.

Contact

Open an issue or reach out to ikarius on Hugging Face.

Last updated: December 18, 2025

Original Model Credits-

Abliteration:huihui-ai

Support the project

Buy huihui-ai a coffee ☕

Base Model:Qwen/Qwen3-8B

HUGGING FACE

上游数据

HF 下载量16
HF 点赞量1

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

SITE STATS

本站统计

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

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

来源与版本

作者
ikarius
最近更新
2025/12/18
最新创建
2025/12/18
HF 趋势
未知
数据快照
2026/09/17
版本
未知
许可证
apache-2.0