Downloads · 30 days
38
7% of all-time downloads
Ssdaizi/Qwen3-VL-2B-Sono
Qwen3-VL-2B-Sono is a machine learning model from Ssdaizi. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
It's a huggingface repository of paper "A Multimodal Instruction Dataset and Benchmark for Ultrasound Understanding".
Downloads · 30 days
38
7% of all-time downloads
All-time downloads
511
Public
Parameters
2.1B
4.3 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors4.3 GB · 100%
From the Hugging Face model README
It's a huggingface repository of paper "A Multimodal Instruction Dataset and Benchmark for Ultrasound Understanding".
from transformers import Qwen3VLForConditionalGeneration, AutoProcessor
import torch
model_path = "Ssdaizi/Qwen3-VL-2B-Sono"
# Load the model
model = Qwen3VLForConditionalGeneration.from_pretrained(
model_path,
dtype=torch.bfloat16,
device_map="auto",
)
processor = AutoProcessor.from_pretrained(model_path)
messages = [
{
"role": "user",
"content": [
{
"type": "image",
"image": "test1.png",
},
{
"type": "text",
"text": "Is this a benign lesion or a malignant lesion?",
}
],
}
]
# Preparation for inference
inputs = processor.apply_chat_template(
messages,
tokenize=True,
add_generation_prompt=True,
return_dict=True,
return_tensors="pt",
)
inputs = inputs.to(model.device)
# Generate response
generated_ids = model.generate(
**inputs,
max_new_tokens=512,
top_p=0.8,
top_k=20,
temperature=0.7,
repetition_penalty=1.0
)
# Remove input tokens from generated output
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])