Image-Text-to-Text
Transformers
Safetensors
PyTorch
English
qwen3_vl
text-generation-inference
uncensored
abliterated
unfiltered
unredacted
vllm
bf16
max
legal
conversational
Instructions to use prithivMLmods/Qwen3-VL-4B-Instruct-Unredacted-MAX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use prithivMLmods/Qwen3-VL-4B-Instruct-Unredacted-MAX with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="prithivMLmods/Qwen3-VL-4B-Instruct-Unredacted-MAX") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("prithivMLmods/Qwen3-VL-4B-Instruct-Unredacted-MAX") model = AutoModelForMultimodalLM.from_pretrained("prithivMLmods/Qwen3-VL-4B-Instruct-Unredacted-MAX", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use prithivMLmods/Qwen3-VL-4B-Instruct-Unredacted-MAX with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "prithivMLmods/Qwen3-VL-4B-Instruct-Unredacted-MAX" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "prithivMLmods/Qwen3-VL-4B-Instruct-Unredacted-MAX", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/prithivMLmods/Qwen3-VL-4B-Instruct-Unredacted-MAX
- SGLang
How to use prithivMLmods/Qwen3-VL-4B-Instruct-Unredacted-MAX with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "prithivMLmods/Qwen3-VL-4B-Instruct-Unredacted-MAX" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "prithivMLmods/Qwen3-VL-4B-Instruct-Unredacted-MAX", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "prithivMLmods/Qwen3-VL-4B-Instruct-Unredacted-MAX" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "prithivMLmods/Qwen3-VL-4B-Instruct-Unredacted-MAX", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use prithivMLmods/Qwen3-VL-4B-Instruct-Unredacted-MAX with Docker Model Runner:
docker model run hf.co/prithivMLmods/Qwen3-VL-4B-Instruct-Unredacted-MAX
Update README.md
Browse files
README.md
CHANGED
|
@@ -23,24 +23,44 @@ tags:
|
|
| 23 |
|
| 24 |
# **Qwen3-VL-4B-Instruct-Unredacted-MAX**
|
| 25 |
|
| 26 |
-
> **Qwen3-VL-4B-Instruct-Unredacted-MAX** is an
|
| 27 |
|
| 28 |
## Key Highlights
|
| 29 |
|
| 30 |
-
* **
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
* **
|
| 34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
## Quick Start with Transformers
|
| 37 |
|
| 38 |
-
```python
|
| 39 |
from transformers import Qwen3VLForConditionalGeneration, AutoProcessor
|
| 40 |
from qwen_vl_utils import process_vision_info
|
| 41 |
import torch
|
| 42 |
|
| 43 |
-
# Load the 4B Unredacted MAX model
|
| 44 |
model = Qwen3VLForConditionalGeneration.from_pretrained(
|
| 45 |
"prithivMLmods/Qwen3-VL-4B-Instruct-Unredacted-MAX",
|
| 46 |
torch_dtype="auto",
|
|
@@ -59,7 +79,7 @@ messages = [
|
|
| 59 |
"type": "image",
|
| 60 |
"image": "https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-VL/assets/demo.jpeg",
|
| 61 |
},
|
| 62 |
-
{"type": "text", "text": "Provide a detailed caption
|
| 63 |
],
|
| 64 |
}
|
| 65 |
]
|
|
@@ -80,12 +100,8 @@ inputs = processor(
|
|
| 80 |
|
| 81 |
generated_ids = model.generate(**inputs, max_new_tokens=256)
|
| 82 |
|
| 83 |
-
generated_ids_trimmed = [
|
| 84 |
-
out_ids[len(in_ids):] for in_ids, out_ids in zip(inputs.input_ids, generated_ids)
|
| 85 |
-
]
|
| 86 |
-
|
| 87 |
output_text = processor.batch_decode(
|
| 88 |
-
|
| 89 |
skip_special_tokens=True,
|
| 90 |
clean_up_tokenization_spaces=False
|
| 91 |
)
|
|
@@ -93,27 +109,23 @@ output_text = processor.batch_decode(
|
|
| 93 |
print(output_text)
|
| 94 |
```
|
| 95 |
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
* **Advanced Red-Teaming**: Evaluating multimodal robustness and probing behavioral edge cases.
|
| 99 |
-
* **Complex Data Archiving**: Generating detailed captions for medical, artistic, historical, or research datasets.
|
| 100 |
-
* **Refusal Mechanism Research**: Studying behavioral shifts in vision-language models after abliterated fine-tuning.
|
| 101 |
-
* **Creative Storytelling**: Producing detailed visual descriptions for narrative and world-building projects.
|
| 102 |
|
| 103 |
-
##
|
| 104 |
|
| 105 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 106 |
|
| 107 |
-
|
| 108 |
-
* **User Responsibility**: Generated outputs must be handled responsibly and used within ethical and legal boundaries.
|
| 109 |
-
* **Hardware Requirements**: While lighter than 8B models, the 4B architecture still requires adequate VRAM for high-resolution image processing and longer generations.
|
| 110 |
|
| 111 |
-
##
|
| 112 |
|
| 113 |
-
|
| 114 |
|
| 115 |
-
*
|
| 116 |
-
*
|
| 117 |
-
*
|
| 118 |
-
*
|
| 119 |
-
* FP8 Floating-Point 8: An Introduction to Efficient, Lower-Precision AI Training – [nvidia](https://developer.nvidia.com/blog/floating-point-8-an-introduction-to-efficient-lower-precision-ai-training/)
|
|
|
|
| 23 |
|
| 24 |
# **Qwen3-VL-4B-Instruct-Unredacted-MAX**
|
| 25 |
|
| 26 |
+
> **Qwen3-VL-4B-Instruct-Unredacted-MAX** is an optimized release built on top of **huihui-ai/Qwen3-VL-4B-Instruct-abliterated**. This version focuses on **improved packaging, updated Transformers compatibility, and stable multimodal inference behavior**, while preserving the core vision-language reasoning capabilities of the original architecture. The result is a capable **4B vision-language model** designed for efficient deployment, research experimentation, and multimodal application development.
|
| 27 |
|
| 28 |
## Key Highlights
|
| 29 |
|
| 30 |
+
* **Optimized Release Packaging**
|
| 31 |
+
Streamlined repository structure for smoother loading, inference, and deployment workflows.
|
| 32 |
+
|
| 33 |
+
* **Modern Transformers Compatibility**
|
| 34 |
+
Updated for stable integration with recent Hugging Face Transformers ecosystems.
|
| 35 |
+
|
| 36 |
+
* **4B Vision-Language Architecture**
|
| 37 |
+
Built on **Qwen3-VL-4B-Instruct**, balancing multimodal capability with relatively low compute requirements.
|
| 38 |
+
|
| 39 |
+
* **Stable Multimodal Inference**
|
| 40 |
+
Designed for consistent performance across image-text reasoning tasks.
|
| 41 |
+
|
| 42 |
+
* **Efficient Caption Generation**
|
| 43 |
+
Produces structured and descriptive outputs suitable for annotation pipelines and dataset creation.
|
| 44 |
+
|
| 45 |
+
* **Dynamic Resolution Support**
|
| 46 |
+
Retains native support for varying image resolutions and aspect ratios.
|
| 47 |
+
|
| 48 |
+
---
|
| 49 |
+
|
| 50 |
+
## Base Model Signatures:
|
| 51 |
+
|
| 52 |
+
This model has been re-sharded and optimized for the latest Transformers version from the base model:
|
| 53 |
+
https://huggingface.co/huihui-ai/Qwen3-VL-4B-Instruct-abliterated
|
| 54 |
+
|
| 55 |
+
---
|
| 56 |
|
| 57 |
## Quick Start with Transformers
|
| 58 |
|
| 59 |
+
```python id="vl4b_code"
|
| 60 |
from transformers import Qwen3VLForConditionalGeneration, AutoProcessor
|
| 61 |
from qwen_vl_utils import process_vision_info
|
| 62 |
import torch
|
| 63 |
|
|
|
|
| 64 |
model = Qwen3VLForConditionalGeneration.from_pretrained(
|
| 65 |
"prithivMLmods/Qwen3-VL-4B-Instruct-Unredacted-MAX",
|
| 66 |
torch_dtype="auto",
|
|
|
|
| 79 |
"type": "image",
|
| 80 |
"image": "https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-VL/assets/demo.jpeg",
|
| 81 |
},
|
| 82 |
+
{"type": "text", "text": "Provide a detailed caption for this image."},
|
| 83 |
],
|
| 84 |
}
|
| 85 |
]
|
|
|
|
| 100 |
|
| 101 |
generated_ids = model.generate(**inputs, max_new_tokens=256)
|
| 102 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 103 |
output_text = processor.batch_decode(
|
| 104 |
+
[out[len(inp):] for inp, out in zip(inputs.input_ids, generated_ids)],
|
| 105 |
skip_special_tokens=True,
|
| 106 |
clean_up_tokenization_spaces=False
|
| 107 |
)
|
|
|
|
| 109 |
print(output_text)
|
| 110 |
```
|
| 111 |
|
| 112 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 113 |
|
| 114 |
+
## Intended Use
|
| 115 |
|
| 116 |
+
* Multimodal AI research and evaluation
|
| 117 |
+
* Vision-language dataset generation and annotation
|
| 118 |
+
* Lightweight deployment on consumer GPUs
|
| 119 |
+
* Prototyping multimodal applications and tools
|
| 120 |
+
* Robustness testing and model benchmarking
|
| 121 |
|
| 122 |
+
---
|
|
|
|
|
|
|
| 123 |
|
| 124 |
+
## Limitations & Risks
|
| 125 |
|
| 126 |
+
> **Important Note**: This model inherits limitations from its base architecture.
|
| 127 |
|
| 128 |
+
* Output quality depends on image clarity and prompt design
|
| 129 |
+
* May produce incomplete or inaccurate interpretations in complex scenarios
|
| 130 |
+
* Requires sufficient VRAM for stable inference
|
| 131 |
+
* Performance varies with decoding strategy and runtime optimizations
|
|
|