Image-Text-to-Text
Transformers
Safetensors
English
opencua
feature-extraction
VLM
Computer-Use-Agent
OS-Agent
GUI
Grounding
conversational
custom_code
Instructions to use xlangai/OpenCUA-72B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use xlangai/OpenCUA-72B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="xlangai/OpenCUA-72B", trust_remote_code=True) 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 AutoModel model = AutoModel.from_pretrained("xlangai/OpenCUA-72B", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use xlangai/OpenCUA-72B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "xlangai/OpenCUA-72B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "xlangai/OpenCUA-72B", "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/xlangai/OpenCUA-72B
- SGLang
How to use xlangai/OpenCUA-72B 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 "xlangai/OpenCUA-72B" \ --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": "xlangai/OpenCUA-72B", "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 "xlangai/OpenCUA-72B" \ --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": "xlangai/OpenCUA-72B", "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 xlangai/OpenCUA-72B with Docker Model Runner:
docker model run hf.co/xlangai/OpenCUA-72B
replace the config.json with a correct version (#2)
Browse files- replace the config.json with a correct version (f47df8bb98a41bd7188ec3d595fa22243de0fef1)
Co-authored-by: mqhuang <LutherXD@users.noreply.huggingface.co>
- config.json +5 -5
config.json
CHANGED
|
@@ -17,17 +17,17 @@
|
|
| 17 |
"eos_token_id": 151644,
|
| 18 |
"head_dim": 128,
|
| 19 |
"hidden_act": "silu",
|
| 20 |
-
"hidden_size":
|
| 21 |
"initializer_range": 0.02,
|
| 22 |
-
"intermediate_size":
|
| 23 |
"k_proj_bias": true,
|
| 24 |
"max_length": 20,
|
| 25 |
"min_length": 0,
|
| 26 |
"model_type": "qwen2",
|
| 27 |
-
"num_attention_heads":
|
| 28 |
"num_beam_groups": 1,
|
| 29 |
"num_beams": 1,
|
| 30 |
-
"num_hidden_layers":
|
| 31 |
"num_key_value_heads": 8,
|
| 32 |
"pad_token_id": 152063,
|
| 33 |
"pretraining_sequence_length": 131072,
|
|
@@ -62,7 +62,7 @@
|
|
| 62 |
"spatial_merge_size": 2,
|
| 63 |
"spatial_patch_size": 14,
|
| 64 |
"temporal_patch_size": 2,
|
| 65 |
-
"out_hidden_size":
|
| 66 |
"tokens_per_second": 2,
|
| 67 |
"window_size": 112
|
| 68 |
},
|
|
|
|
| 17 |
"eos_token_id": 151644,
|
| 18 |
"head_dim": 128,
|
| 19 |
"hidden_act": "silu",
|
| 20 |
+
"hidden_size": 8192,
|
| 21 |
"initializer_range": 0.02,
|
| 22 |
+
"intermediate_size": 29568,
|
| 23 |
"k_proj_bias": true,
|
| 24 |
"max_length": 20,
|
| 25 |
"min_length": 0,
|
| 26 |
"model_type": "qwen2",
|
| 27 |
+
"num_attention_heads": 64,
|
| 28 |
"num_beam_groups": 1,
|
| 29 |
"num_beams": 1,
|
| 30 |
+
"num_hidden_layers": 80,
|
| 31 |
"num_key_value_heads": 8,
|
| 32 |
"pad_token_id": 152063,
|
| 33 |
"pretraining_sequence_length": 131072,
|
|
|
|
| 62 |
"spatial_merge_size": 2,
|
| 63 |
"spatial_patch_size": 14,
|
| 64 |
"temporal_patch_size": 2,
|
| 65 |
+
"out_hidden_size": 8192,
|
| 66 |
"tokens_per_second": 2,
|
| 67 |
"window_size": 112
|
| 68 |
},
|