Image-Text-to-Text
Transformers
Safetensors
English
qwen2_vl
multimodel
gui
conversational
text-generation-inference
Instructions to use Fintor/Fintor-GUI-S2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Fintor/Fintor-GUI-S2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Fintor/Fintor-GUI-S2") 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("Fintor/Fintor-GUI-S2") model = AutoModelForImageTextToText.from_pretrained("Fintor/Fintor-GUI-S2") 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 Fintor/Fintor-GUI-S2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Fintor/Fintor-GUI-S2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Fintor/Fintor-GUI-S2", "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/Fintor/Fintor-GUI-S2
- SGLang
How to use Fintor/Fintor-GUI-S2 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 "Fintor/Fintor-GUI-S2" \ --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": "Fintor/Fintor-GUI-S2", "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 "Fintor/Fintor-GUI-S2" \ --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": "Fintor/Fintor-GUI-S2", "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 Fintor/Fintor-GUI-S2 with Docker Model Runner:
docker model run hf.co/Fintor/Fintor-GUI-S2
Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
datasets:
|
| 4 |
+
- OS-Copilot/OS-Atlas-data
|
| 5 |
+
language:
|
| 6 |
+
- en
|
| 7 |
+
base_model:
|
| 8 |
+
- bytedance-research/UI-TARS-7B-DPO
|
| 9 |
+
pipeline_tag: image-text-to-text
|
| 10 |
+
library_name: transformers
|
| 11 |
+
tags:
|
| 12 |
+
- multimodel
|
| 13 |
+
- gui
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
## Model Description
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
Ui-Taris-7B-Instruct-Finetuned-Os-Atlas is a GUI grounding model finetuned from [**UI-TARS-7B-DPO**](https://huggingface.co/bytedance-research/UI-TARS-7B-DPO).
|
| 20 |
+
|
| 21 |
+
This model used the OS-Copilot dataset for fine-tuning: [OS-Copilot](https://huggingface.co/datasets/OS-Copilot/OS-Atlas-data/tree/main).
|
| 22 |
+
|
| 23 |
+
## Evaluation Results
|
| 24 |
+
|
| 25 |
+
We evaluated our model using [Screenspot](https://github.com/likaixin2000/ScreenSpot-Pro-GUI-Grounding) on two benchmarks: Screenspot Pro and Screenspot v2.
|
| 26 |
+
|
| 27 |
+
We also include evaluation scripts used on these benchmarks. The table below compares our model's performance against the base model performance.
|
| 28 |
+
|
| 29 |
+
| Model | size | Screenspot Pro | Screenspot v2 |
|
| 30 |
+
|-------|:----:|:--------------:|:----------:|
|
| 31 |
+
| [UI-TARS-7B-DPO](https://huggingface.co/bytedance-research/UI-TARS-7B-DPO) | 7B | 27.0 | 83.0 |
|
| 32 |
+
| **Ours** | | | |
|
| 33 |
+
| **Ui-Taris-7B-Instruct-Finetuned-Os-Atlas** | 7B | **33.0** | **91.8** |
|
| 34 |
+
|
| 35 |
+
**Note - The base model scores slightly lower than the mentioned scores in the paper because the prompts used for evaluation are not publicly available. We used the default prompts when evaluating the base and fine-tuned models.**
|
| 36 |
+
|
| 37 |
+
## Training procedure
|
| 38 |
+
|
| 39 |
+
[<img src="https://raw.githubusercontent.com/wandb/assets/main/wandb-github-badge-28.svg" alt="Visualize in Weights & Biases" width="150" height="24"/>](https://wandb.ai/am_fintor-neuralleap/huggingface/runs/hl90xquy?nw=nwuseram_fintor)
|
| 40 |
+
|
| 41 |
+
This model was trained with SFT and LoRA.
|
| 42 |
+
|
| 43 |
+
### Evaluation Scripts:
|
| 44 |
+
|
| 45 |
+
Evaluation scripts available here - [Screenspot_Ui-Taris](https://github.com/ma-neuralleap/ScreenSpot-Pro-GUI-Grounding/blob/main/models/uitaris.py)
|
| 46 |
+
|
| 47 |
+
### Quick Start
|
| 48 |
+
```python
|
| 49 |
+
from transformers import Qwen2VLForConditionalGeneration, AutoTokenizer, AutoProcessor
|
| 50 |
+
from qwen_vl_utils import process_vision_info
|
| 51 |
+
# default: Load the model on the available device(s)
|
| 52 |
+
model = Qwen2VLForConditionalGeneration.from_pretrained(
|
| 53 |
+
"Fintor/Ui-Taris-7B-Instruct-Finetuned-Os-Atlas",
|
| 54 |
+
torch_dtype=torch.bfloat16,
|
| 55 |
+
attn_implementation="flash_attention_2",
|
| 56 |
+
device_map="auto",
|
| 57 |
+
)
|
| 58 |
+
# default processer
|
| 59 |
+
processor = AutoProcessor.from_pretrained("Fintor/Ui-Taris-7B-Instruct-Finetuned-Os-Atlas")
|
| 60 |
+
# Example input
|
| 61 |
+
messages = [
|
| 62 |
+
{
|
| 63 |
+
"role": "user",
|
| 64 |
+
"content": [
|
| 65 |
+
{
|
| 66 |
+
"type": "image",
|
| 67 |
+
"image": "path/to/image.jpeg",
|
| 68 |
+
},
|
| 69 |
+
{"type": "text", "text": "Describe this image."},
|
| 70 |
+
],
|
| 71 |
+
}
|
| 72 |
+
]
|
| 73 |
+
# Preparation for inference
|
| 74 |
+
text = processor.apply_chat_template(
|
| 75 |
+
messages, tokenize=False, add_generation_prompt=True
|
| 76 |
+
)
|
| 77 |
+
image_inputs, video_inputs = process_vision_info(messages)
|
| 78 |
+
inputs = processor(
|
| 79 |
+
text=[text],
|
| 80 |
+
images=image_inputs,
|
| 81 |
+
videos=video_inputs,
|
| 82 |
+
padding=True,
|
| 83 |
+
return_tensors="pt",
|
| 84 |
+
)
|
| 85 |
+
inputs = inputs.to("cuda")
|
| 86 |
+
# Inference: Generation of the output
|
| 87 |
+
generated_ids = model.generate(**inputs, max_new_tokens=128)
|
| 88 |
+
generated_ids_trimmed = [
|
| 89 |
+
out_ids[len(in_ids) :] for in_ids, out_ids in zip(inputs.input_ids, generated_ids)
|
| 90 |
+
]
|
| 91 |
+
output_text = processor.batch_decode(
|
| 92 |
+
generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False
|
| 93 |
+
)
|
| 94 |
+
print(output_text)
|
| 95 |
+
```
|
| 96 |
+
|
| 97 |
+
|
| 98 |
+
## Citation
|