Views
No views yet

Qwen3-VL-8B-Instruct-abliterated-v2.0 is an abliterated (v2.0) variant of Qwen3-VL-8B-Instruct, designed for Abliterated Reasoning and Captioning. This model is fine-tuned to produce highly detailed, descriptive, and reasoning-focused outputs across a wide range of visual and multimodal contexts, including complex, sensitive, or nuanced content. It supports varied image resolutions and aspect ratios while maintaining interpretive coherence and descriptive accuracy.
1from transformers import Qwen3VLForConditionalGeneration, AutoProcessor
2from qwen_vl_utils import process_vision_info
3import torch
4
5model = Qwen3VLForConditionalGeneration.from_pretrained(
6 "prithivMLmods/Qwen3-VL-8B-Instruct-abliterated-v2",
7 torch_dtype="auto",
8 device_map="auto"
9)
10
11processor = AutoProcessor.from_pretrained("prithivMLmods/Qwen3-VL-8B-Instruct-abliterated-v2")
12
13messages = [
14 {
15 "role": "user",
16 "content": [
17 {
18 "type": "image",
19 "image": "https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-VL/assets/demo.jpeg",
20 },
21 {"type": "text", "text": "Provide a detailed caption and reasoning for this image."},
22 ],
23 }
24]
25
26text = processor.apply_chat_template(
27 messages, tokenize=False, add_generation_prompt=True
28)
29image_inputs, video_inputs = process_vision_info(messages)
30
31inputs = processor(
32 text=[text],
33 images=image_inputs,
34 videos=video_inputs,
35 padding=True,
36 return_tensors="pt",
37).to("cuda")
38
39generated_ids = model.generate(**inputs, max_new_tokens=128)
40
41generated_ids_trimmed = [
42 out_ids[len(in_ids):] for in_ids, out_ids in zip(inputs.input_ids, generated_ids)
43]
44
45output_text = processor.batch_decode(
46 generated_ids_trimmed,
47 skip_special_tokens=True,
48 clean_up_tokenization_spaces=False
49)
50
51print(output_text)