mohammedalmatari commited on
Commit
208ec29
·
verified ·
1 Parent(s): 5c1020f

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +98 -0
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