Image-Text-to-Text
Transformers
Safetensors
qwen2_5_vl
vision
qwen2.5-vl
ui-grounding
fine-tuned
conversational
text-generation-inference
Instructions to use BLR2/qwen2.5-vl-3b-ui-grounding-step-11000 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use BLR2/qwen2.5-vl-3b-ui-grounding-step-11000 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="BLR2/qwen2.5-vl-3b-ui-grounding-step-11000") 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("BLR2/qwen2.5-vl-3b-ui-grounding-step-11000") model = AutoModelForMultimodalLM.from_pretrained("BLR2/qwen2.5-vl-3b-ui-grounding-step-11000", 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 BLR2/qwen2.5-vl-3b-ui-grounding-step-11000 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "BLR2/qwen2.5-vl-3b-ui-grounding-step-11000" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "BLR2/qwen2.5-vl-3b-ui-grounding-step-11000", "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/BLR2/qwen2.5-vl-3b-ui-grounding-step-11000
- SGLang
How to use BLR2/qwen2.5-vl-3b-ui-grounding-step-11000 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 "BLR2/qwen2.5-vl-3b-ui-grounding-step-11000" \ --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": "BLR2/qwen2.5-vl-3b-ui-grounding-step-11000", "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 "BLR2/qwen2.5-vl-3b-ui-grounding-step-11000" \ --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": "BLR2/qwen2.5-vl-3b-ui-grounding-step-11000", "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 BLR2/qwen2.5-vl-3b-ui-grounding-step-11000 with Docker Model Runner:
docker model run hf.co/BLR2/qwen2.5-vl-3b-ui-grounding-step-11000
Fine-tuned Qwen2.5-VL-3B for UI Element Localization - Step 11000
This model is a fine-tuned version of Qwen/Qwen2.5-VL-3B-Instruct trained on the SeeClick dataset for predicting UI element coordinates.
Training Details
- Base Model: Qwen/Qwen2.5-VL-3B-Instruct
- Training Step: 11000
- Task: Given a UI screenshot and element description, predict the center coordinates (x, y) of the element.
Usage
from transformers import Qwen2_5_VLForConditionalGeneration, AutoProcessor
from qwen_vl_utils import process_vision_info
from PIL import Image
import torch
model_name = "BLR2/qwen2.5-vl-3b-ui-grounding-step-11000"
processor = AutoProcessor.from_pretrained(model_name)
model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
model_name,
torch_dtype=torch.bfloat16,
device_map="auto",
)
image = Image.open("screenshot.png").convert("RGB")
messages = [
{
"role": "user",
"content": [
{"type": "image", "image": image},
{"type": "text", "text": "Given this UI screenshot, predict the center of: 'Submit button'."},
],
},
]
text = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
img, vid = process_vision_info(messages)
inputs = processor(text=[text], images=img, videos=None, padding=True, return_tensors="pt")
inputs = {k: v.to(model.device) for k, v in inputs.items()}
with torch.no_grad():
generated_ids = model.generate(**inputs, max_new_tokens=128, do_sample=False)
generated_ids_trimmed = generated_ids[0][len(inputs["input_ids"][0]):]
response = processor.decode(generated_ids_trimmed, skip_special_tokens=True)
print(response) # Output: "0.7532 0.8921" (x, y coordinates)
Output Format
The model outputs normalized coordinates in the format x y where both values are in the range [0, 1]:
x: horizontal position (0 = left, 1 = right)y: vertical position (0 = top, 1 = bottom)
- Downloads last month
- -
Model tree for BLR2/qwen2.5-vl-3b-ui-grounding-step-11000
Base model
Qwen/Qwen2.5-VL-3B-Instruct