Instructions to use HoshiuZ/Qwen3-VL-8B-Unlearned with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use HoshiuZ/Qwen3-VL-8B-Unlearned with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="HoshiuZ/Qwen3-VL-8B-Unlearned") 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)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("HoshiuZ/Qwen3-VL-8B-Unlearned") model = AutoModelForMultimodalLM.from_pretrained("HoshiuZ/Qwen3-VL-8B-Unlearned", 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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use HoshiuZ/Qwen3-VL-8B-Unlearned with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "HoshiuZ/Qwen3-VL-8B-Unlearned" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "HoshiuZ/Qwen3-VL-8B-Unlearned", "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/HoshiuZ/Qwen3-VL-8B-Unlearned
- SGLang
How to use HoshiuZ/Qwen3-VL-8B-Unlearned 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 "HoshiuZ/Qwen3-VL-8B-Unlearned" \ --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": "HoshiuZ/Qwen3-VL-8B-Unlearned", "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 "HoshiuZ/Qwen3-VL-8B-Unlearned" \ --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": "HoshiuZ/Qwen3-VL-8B-Unlearned", "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 HoshiuZ/Qwen3-VL-8B-Unlearned with Docker Model Runner:
docker model run hf.co/HoshiuZ/Qwen3-VL-8B-Unlearned
Qwen3-VL-8B-Instruct โ sparse unlearned checkpoint
A full multimodal checkpoint reconstructed from the exact base revision and the identified sparse weight update. The model retains the source wrapper and vision components.
Evaluation scope
Evaluation used text-only input on the frozen 3,668-item WMDP C set. This does not evaluate image or broader multimodal safety. The reported C result is from the frozen scoring run; this exported HF checkpoint was separately compared against the same edited full wrapper on CPU, tensor by tensor.
For base accuracy A0 = base_correct / n and edited accuracy Au = edited_correct / n, the project reports C = (A0 - Au) / (A0 - 0.25). The exact result is shown as a reduced fraction as well as a percentage.
| WMDP C items | Base correct | Edited correct | Exact C | C |
|---|---|---|---|---|
| 3668 | 2272 | 1073 | 1199/1355 | 88.4871% |
The separate text-only S evaluation is complete (raw S: 99.199443%; capped S: 99.199443%). See the S results at the frozen project commit. No image-safety or general multimodal-safety claim is made.
Source and edit
- Full multimodal base:
Qwen/Qwen3-VL-8B-Instruct - Frozen base revision:
0c351dd01ed87e9c1b53cbc748cba10e6187ff3b - Wrapper class:
Qwen3VLForConditionalGeneration - Sparse update SHA-256:
53b2ed3e8b9b3a21884d48ec9c784de67d6b6b9d4f6e0c912ff4326833f30d68(402,656,007 bytes) - Changed weights: language-model MLP
down_projmatrices in layers 4, 5, 6, 7.
The sparse edit was produced by a cyber-direction GROM closed-form edit followed by the recorded NPO steps. Only the listed down_proj matrices are included in the update.
Loading
Use the complete model through Transformers; no training code or overlay application is needed at load time.
import torch
from transformers import AutoProcessor, Qwen3VLForConditionalGeneration
repo = "HoshiuZ/Qwen3-VL-8B-Unlearned"
processor = AutoProcessor.from_pretrained(repo)
model = Qwen3VLForConditionalGeneration.from_pretrained(
repo, torch_dtype=torch.bfloat16, device_map="auto"
)
License and attribution
The source checkpoint is marked Apache-2.0. See LICENSE, Apache License 2.0, and the source model card. This repository does not claim Qwen affiliation or endorsement.
Source code
Research and implementation source: HoshiuZ/multimodal-llm-safety.
- Downloads last month
- 25
Model tree for HoshiuZ/Qwen3-VL-8B-Unlearned
Base model
Qwen/Qwen3-VL-8B-Instruct