Image-Text-to-Text
Transformers
Safetensors
qwen2_vl
conversational
Eval Results
text-generation-inference
Instructions to use microsoft/GUI-Actor-2B-Qwen2-VL with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use microsoft/GUI-Actor-2B-Qwen2-VL with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="microsoft/GUI-Actor-2B-Qwen2-VL") 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, Qwen2VLForConditionalGenerationWithPointer processor = AutoProcessor.from_pretrained("microsoft/GUI-Actor-2B-Qwen2-VL") model = Qwen2VLForConditionalGenerationWithPointer.from_pretrained("microsoft/GUI-Actor-2B-Qwen2-VL", 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 microsoft/GUI-Actor-2B-Qwen2-VL with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "microsoft/GUI-Actor-2B-Qwen2-VL" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "microsoft/GUI-Actor-2B-Qwen2-VL", "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/microsoft/GUI-Actor-2B-Qwen2-VL
- SGLang
How to use microsoft/GUI-Actor-2B-Qwen2-VL 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 "microsoft/GUI-Actor-2B-Qwen2-VL" \ --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": "microsoft/GUI-Actor-2B-Qwen2-VL", "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 "microsoft/GUI-Actor-2B-Qwen2-VL" \ --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": "microsoft/GUI-Actor-2B-Qwen2-VL", "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 microsoft/GUI-Actor-2B-Qwen2-VL with Docker Model Runner:
docker model run hf.co/microsoft/GUI-Actor-2B-Qwen2-VL
Commit History
-
Add ScreenSpot-Pro evaluation result (GUI-Actor-2VL-2B)
Verified signature7373da8
-
Update README.md
Verified signature8f87b36
-
Update README.md
Verified signaturec694fa0
-
add dataset link.
Verified signature8bea665
-
Update README.md
Verified signature713a749 -
Remove `size` from processor config file to be compatible with Qwen2.5VL and transformer 4.51.3
Verified signature46b4c56
-
Improve model card with pipeline tag and library name (#1)
Verified signature- Improve model card with pipeline tag and library name (574aaceec686b444d1528f162101d5d98f1b06cb) Co-authored-by: Niels Rogge <nielsr@users.noreply.huggingface.co>28fa840
-
update paper link.
Verified signature4770c51
-
update model card.
Verified signature9979c7f -
update model card.
Verified signatured6f77cc -
Add model card.
Verified signatured8a8183
-
Upload model weights.
Verified signature42bcf36 -
initial commit
Verified signature421d552