Instructions to use ddvd233/QoQ-Med-VL-32B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ddvd233/QoQ-Med-VL-32B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="ddvd233/QoQ-Med-VL-32B") 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, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("ddvd233/QoQ-Med-VL-32B") model = AutoModelForImageTextToText.from_pretrained("ddvd233/QoQ-Med-VL-32B") 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
- vLLM
How to use ddvd233/QoQ-Med-VL-32B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ddvd233/QoQ-Med-VL-32B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ddvd233/QoQ-Med-VL-32B", "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/ddvd233/QoQ-Med-VL-32B
- SGLang
How to use ddvd233/QoQ-Med-VL-32B 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 "ddvd233/QoQ-Med-VL-32B" \ --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": "ddvd233/QoQ-Med-VL-32B", "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 "ddvd233/QoQ-Med-VL-32B" \ --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": "ddvd233/QoQ-Med-VL-32B", "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 ddvd233/QoQ-Med-VL-32B with Docker Model Runner:
docker model run hf.co/ddvd233/QoQ-Med-VL-32B
QoQ-Med: Building Multimodal Clinical Foundation Models with Domain-Aware GRPO Training
This repository contains the model weights for QoQ-Med-VL-32B (Qwen Omni-Reasoning on Medical Questions), a multimodal clinical foundation model with reasoning capabilities.
\ud83d\udcda Paper - \ud83d\udcbb Code
Model Weights
| Model | Weights | Avg. Val Accuracy |
|---|---|---|
| QoQ-Med-VL-7B | \ud83e\udd17 HuggingFace | 68.6% |
| QoQ-Med-VL-32B | \ud83e\udd17 HuggingFace | 70.7% |
Quick Start
Installation
First, ensure you have the necessary dependencies:
pip install transformers qwen-vl-utils torch
Loading the Model
You may load the QoQ-Med model and processors via transformers package:
from transformers import AutoModelForVision2Seq, AutoProcessor
model = AutoModelForVision2Seq.from_pretrained(
"ddvd233/QoQ-Med-VL-32B",
torch_dtype="auto",
device_map="auto"
)
processor = AutoProcessor.from_pretrained("ddvd233/QoQ-Med-VL-32B")
For better performance with flash attention:
import torch
from transformers import AutoModelForVision2Seq
model = AutoModelForVision2Seq.from_pretrained(
"ddvd233/QoQ-Med-VL-32B",
torch_dtype=torch.bfloat16,
attn_implementation="flash_attention_2",
device_map="auto",
)
Configuring Visual Token Range
You can adjust the visual token range to balance performance and computational cost:
min_pixels = 256 * 28 * 28
max_pixels = 1280 * 28 * 28
processor = AutoProcessor.from_pretrained(
"ddvd233/QoQ-Med-VL-32B",
min_pixels=min_pixels,
max_pixels=max_pixels
)
Preparing Multimodal Input
Create a message with both image and text content:
messages = [
{
"role": "user",
"content": [
{
"type": "image",
"image": "path/to/your/medical/image.jpg",
},
{"type": "text", "text": "Describe this medical image."},
],
}
]
Processing the Input
Prepare the input for model inference:
from qwen_vl_utils import process_vision_info
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")
Generating Output
Run inference and decode 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[0])
Citations
If you find the project useful, please cite the following papers:
@article{dai2025climb,
title={Climb: Data foundations for large scale multimodal clinical foundation models},
author={Dai, Wei and Chen, Peilin and Lu, Malinda and Li, Daniel and Wei, Haowen and Cui, Hejie and Liang, Paul Pu},
journal={International Conference on Machine Learning},
year={2025}
}
@article{dai2025qoq,
title={QoQ-Med: Building Multimodal Clinical Foundation Models with Domain-Aware GRPO Training},
author={Dai, Wei and Chen, Peilin and Ekbote, Chanakya and Liang, Paul Pu},
journal={arXiv preprint arXiv:2506.00711},
year={2025}
}
- Downloads last month
- 20