Image-Text-to-Text
Transformers
Safetensors
qwen2_vl
conversational
Eval Results
text-generation-inference
Run this model with HF Jobs
Run OS-Copilot/OS-Atlas-Pro-7B on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/OS-Copilot/OS-Atlas-Pro-7B. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/OS-Copilot/OS-Atlas-Pro-7B on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/OS-Copilot/OS-Atlas-Pro-7B. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/OS-Copilot/OS-Atlas-Pro-7B. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use OS-Copilot/OS-Atlas-Pro-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OS-Copilot/OS-Atlas-Pro-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="OS-Copilot/OS-Atlas-Pro-7B") 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, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("OS-Copilot/OS-Atlas-Pro-7B") model = AutoModelForMultimodalLM.from_pretrained("OS-Copilot/OS-Atlas-Pro-7B", 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 OS-Copilot/OS-Atlas-Pro-7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OS-Copilot/OS-Atlas-Pro-7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OS-Copilot/OS-Atlas-Pro-7B", "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/OS-Copilot/OS-Atlas-Pro-7B
- SGLang
How to use OS-Copilot/OS-Atlas-Pro-7B 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 "OS-Copilot/OS-Atlas-Pro-7B" \ --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": "OS-Copilot/OS-Atlas-Pro-7B", "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 "OS-Copilot/OS-Atlas-Pro-7B" \ --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": "OS-Copilot/OS-Atlas-Pro-7B", "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 OS-Copilot/OS-Atlas-Pro-7B with Docker Model Runner:
docker model run hf.co/OS-Copilot/OS-Atlas-Pro-7B
Update README.md
Browse files27 unmodified lines28293031323327 unmodified lines## OS-Atlas-Action-7B## Citation27 unmodified lines28293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117227 unmodified lines## OS-Atlas-Action-7B`OS-Atlas-Action-7B` is a GUI action model finetuned from OS-Atlas-Base-7B. By taking as input a system prompt, basic and custom actions, and a task instruction, the model generates thoughtful reasoning (`thought`) and executes the appropriate next step (`action`).### InstallationTo use `OS-Atlas-Action-7B`, first install the necessary dependencies:```bashpip install transformerspip install qwen-vl-utils```### Example Inference CodeBelow is an example of how to perform inference using the model:```pythonfrom transformers import Qwen2VLForConditionalGeneration, AutoProcessorfrom qwen_vl_utils import process_vision_info# Load the model and processormodel = Qwen2VLForConditionalGeneration.from_pretrained("/nas/shared/NLP_A100/wuzhenyu/ckpt/241029-qwen-stage2", torch_dtype="auto", device_map="auto")processor = AutoProcessor.from_pretrained("/nas/shared/NLP_A100/wuzhenyu/ckpt/20240928_finetune_qwen_7b_3m_imgsiz_1024_bs_1024_lr_1e-7_wd_1e-3_mixture")# Define the system promptsys_prompt = """You are now operating in Executable Language Grounding mode. Your goal is to help users accomplish tasks by suggesting executable actions that best fit their needs. Your skill set includes both basic and custom actions:1. Basic ActionsBasic actions are standardized and available across all platforms. They provide essential functionality and are defined with a specific format, ensuring consistency and reliability.Basic Action 1: CLICK- purpose: Click at the specified position.- format: CLICK <point>[[x-axis, y-axis]]</point>- example usage: CLICK <point>[[101, 872]]</point>Basic Action 2: TYPE- purpose: Enter specified text at the designated location.- format: TYPE [input text]- example usage: TYPE [Shanghai shopping mall]Basic Action 3: SCROLL- purpose: SCROLL in the specified direction.- format: SCROLL [direction (UP/DOWN/LEFT/RIGHT)]- example usage: SCROLL [UP]2. Custom ActionsCustom actions are unique to each user's platform and environment. They allow for flexibility and adaptability, enabling the model to support new and unseen actions defined by users. These actions extend the functionality of the basic set, making the model more versatile and capable of handling specific tasks.Custom Action 1: LONG_PRESS- purpose: Long press at the specified position.- format: LONG_PRESS <point>[[x-axis, y-axis]]</point>- example usage: LONG_PRESS <point>[[101, 872]]</point>Custom Action 2: OPEN_APP- purpose: Open the specified application.- format: OPEN_APP [app_name]- example usage: OPEN_APP [Google Chrome]Custom Action 3: PRESS_BACK- purpose: Press a back button to navigate to the previous screen.- format: PRESS_BACK- example usage: PRESS_BACKCustom Action 4: PRESS_HOME- purpose: Press a home button to navigate to the home page.- format: PRESS_HOME- example usage: PRESS_HOMECustom Action 5: PRESS_RECENT- purpose: Press the recent button to view or switch between recently used applications.- format: PRESS_RECENT- example usage: PRESS_RECENTCustom Action 6: ENTER- purpose: Press the enter button.- format: ENTER- example usage: ENTERCustom Action 7: WAIT- purpose: Wait for the screen to load.- format: WAIT- example usage: WAITCustom Action 8: COMPLETE- purpose: Indicate the task is finished.- format: COMPLETE- example usage: COMPLETEIn most cases, task instructions are high-level and abstract. Carefully read the instruction and action history, then perform reasoning to determine the most appropriate next action. Ensure you strictly generate two sections: Thoughts and Actions.Thoughts: Clearly outline your reasoning process for current step.Actions: Specify the actual actions you will take based on your reasoning. You should follow action format above when generating.Your current task instruction, action history, and associated screenshot are as follows:Screenshot:"""# Define the input messagemessages = [{"role": "user","content": [{"type": "text", "text": sys_prompt,},{"type": "image","image": "https://github.com/OS-Copilot/OS-Atlas/blob/main/exmaples/images/action_example_1.jpg",},{"type": "text", "text": "Task instruction: to allow the user to enter their first name\nHistory: null" },],}]# Prepare the input for the modeltext = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)image_inputs, video_inputs = process_vision_info(messages)inputs = processor(text=[text],images=image_inputs,videos=video_inputs,padding=True,return_tensors="pt",)inputs = inputs.to("cuda")# Generate outputgenerated_ids = model.generate(**inputs, max_new_tokens=128)# Post-process the outputgenerated_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=False, clean_up_tokenization_spaces=False)print(output_text)```## Citation
README.md+139