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

QVQ-72B-Preview-abliterated-6.5bpw-h8-exl2

HF 源站

matatonic/QVQ-72B-Preview-abliterated-6.5bpw-h8-exl2 is an uncensored open-source model hosted on Hugging Face.

Image-Text-to-TextsafetensorsEnglishLicense: other72Btransformersqwen2_vlabliterateduncensored - chatconversationaltext-generation-inferenceexl2
README.md说明 / 使用方法

license: other license_name: qwen license_link: https://huggingface.co/huihui-ai/QVQ-72B-Preview-abliterated/blob/main/LICENSE language:

  • en pipeline_tag: image-text-to-text base_model: Qwen/QVQ-72B-Preview tags:
  • abliterated
  • uncensored
    • chat library_name: transformers

huihui-ai/QVQ-72B-Preview-abliterated

This is an uncensored version of Qwen/QVQ-72B-Preview created with abliteration (see remove-refusals-with-transformers to know more about it).

This is a crude, proof-of-concept implementation to remove refusals from an LLM model without using TransformerLens.

It was only the text part that was processed, not the image part.

Usage

We offer a toolkit to help you handle various types of visual input more conveniently. This includes base64, URLs, and interleaved images and videos. You can install it using the following command:

pip install qwen-vl-utils

Here we show a code snippet to show you how to use the chat model with transformers and qwen_vl_utils:

from transformers import Qwen2VLForConditionalGeneration, AutoTokenizer, AutoProcessor
from qwen_vl_utils import process_vision_info

# default: Load the model on the available device(s)
model = Qwen2VLForConditionalGeneration.from_pretrained(
    "huihui-ai/QVQ-72B-Preview-abliterated", torch_dtype="auto", device_map="auto"
)

# default processer
processor = AutoProcessor.from_pretrained("huihui-ai/QVQ-72B-Preview-abliterated")

# The default range for the number of visual tokens per image in the model is 4-16384. You can set min_pixels and max_pixels according to your needs, such as a token count range of 256-1280, to balance speed and memory usage.
# min_pixels = 256*28*28
# max_pixels = 1280*28*28
# processor = AutoProcessor.from_pretrained("huihui-ai/QVQ-72B-Preview-abliterated", min_pixels=min_pixels, max_pixels=max_pixels)

messages = [
    {
        "role": "system",
        "content": [
            {"type": "text", "text": "You are a helpful and harmless assistant. You are Qwen developed by Alibaba. You should think step-by-step."}
        ],
    },
    {
        "role": "user",
        "content": [
            {
                "type": "image",
                "image": "https://qianwen-res.oss-cn-beijing.aliyuncs.com/QVQ/demo.png",
            },
            {"type": "text", "text": "What value should be filled in the blank space?"},
        ],
    }
]

# Preparation for inference
text = processor.apply_chat_template(
    messages, tokenize=False, add_generation_prompt=True
)
image_inputs, video_inputs = process_vision_info(messages)
inputs = processor(
    text=[text],
    images=image_inputs,
    videos=video_inputs,
    padding=True,
    return_tensors="pt",
)
inputs = inputs.to("cuda")

# Inference: Generation of the output
generated_ids = model.generate(**inputs, max_new_tokens=8192)
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)


HUGGING FACE

上游数据

HF 下载量16
HF 点赞量1

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

SITE STATS

本站统计

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

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

来源与版本

作者
matatonic
最近更新
2025/01/06
最新创建
2025/01/06
HF 趋势
未知
数据快照
2026/09/17
版本
未知
许可证
other