license: apache-2.0 base_model:
- Qwen/Qwen3-VL-8B-Instruct pipeline_tag: image-text-to-text tags:
- abliterated
- uncensored library_name: transformers
huihui-ai/Huihui-Qwen3-VL-8B-Instruct-abliterated
这是通过 abliteration(去拒绝微调技术)制作的 Qwen/Qwen3-VL-8B-Instruct 无审查版本(了解更多详情请参阅 remove-refusals-with-transformers)。
处理仅针对文本部分进行,未改动图像部分。
经过 abliterated 处理的模型将不再回复“我无法描述或分析此图像”("I can’t describe or analyze this image.")。
ollama
请更新至最新版本 Ollama-v0.12.7。
可以直接使用 huihui_ai/qwen3-vl-abliterated:8b-instruct:
ollama run huihui_ai/qwen3-vl-abliterated:8b-instruct
图像对话(Chat with Image)
from transformers import Qwen3VLForConditionalGeneration, AutoProcessor, BitsAndBytesConfig
import os
import torch
cpu_count = os.cpu_count()
print(f"Number of CPU cores in the system: {cpu_count}")
half_cpu_count = cpu_count // 2
os.environ["MKL_NUM_THREADS"] = str(half_cpu_count)
os.environ["OMP_NUM_THREADS"] = str(half_cpu_count)
torch.set_num_threads(half_cpu_count)
MODEL_ID = "huihui-ai/Huihui-Qwen3-VL-8B-Instruct-abliterated"
# default: Load the model on the available device(s)
model = Qwen3VLForConditionalGeneration.from_pretrained(
MODEL_ID,
device_map="auto",
trust_remote_code=True,
dtype=torch.bfloat16,
low_cpu_mem_usage=True,
)
# We recommend enabling flash_attention_2 for better acceleration and memory saving, especially in multi-image and video scenarios.
# model = Qwen3VLForConditionalGeneration.from_pretrained(
# "Qwen/Qwen3-VL-235B-A22B-Instruct",
# dtype=torch.bfloat16,
# attn_implementation="flash_attention_2",
# device_map="auto",
# )
processor = AutoProcessor.from_pretrained(MODEL_ID)
image_path = "/png/cars.jpg"
messages = [
{
"role": "user",
"content": [
{
"type": "image", "image": f"{image_path}",
},
{"type": "text", "text": "Describe this image."},
],
}
]
# Preparation for inference
inputs = processor.apply_chat_template(
messages,
tokenize=True,
add_generation_prompt=True,
return_dict=True,
return_tensors="pt"
).to(model.device)
# Inference: Generation of the output
generated_ids = model.generate(**inputs, max_new_tokens=128)
generated_ids_trimmed = [
out_ids[len(in_ids) :] for in_ids, out_ids in zip(inputs.input_ids, generated_ids)
]
output_text = processor.batch_decode(
generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False
)
print(output_text)
使用警告(Usage Warnings)
-
敏感或争议性输出风险:该模型的安全过滤机制已被大幅弱化,可能会生成敏感、具有争议或不当的内容。用户应保持谨慎并严格审查生成的内容。
-
不适合所有受众:由于内容过滤受限,模型的输出可能不适合在公开场合使用,也不适合未成年人或对安全性要求极高的应用场景。
-
法律与道德责任:用户必须确保其使用符合当地法律法规及道德伦理标准。生成的内容可能带有法律或道德风险,由用户自行承担全部责任与后果。
-
研究与实验用途:建议仅在科研、测试或受控环境下使用该模型,避免直接用于生产环境或面向公众的商业化应用。
-
监控与审查建议:强烈建议用户对模型输出进行实时监控,并在必要时开展人工审核,以防止不当内容的传播。
-
无默认安全保障:与标准模型不同,该模型未经严格的安全优化。huihui.ai 对因使用该模型而产生的任何后果概不负责。
赞助支持(Donation)
您的赞助能支持我们持续进行开发与改进,一杯咖啡足矣。
- 比特币(Bitcoin):
bc1qqnkhuchxw0zqjh2ku3lu4hq45hc6gy84uk70ge
- 在 Ko-fi 上支持我们的工作!