Instructions to use THUSI-Lab/GameDojo-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use THUSI-Lab/GameDojo-4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="THUSI-Lab/GameDojo-4B") 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("THUSI-Lab/GameDojo-4B") model = AutoModelForMultimodalLM.from_pretrained("THUSI-Lab/GameDojo-4B", 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 THUSI-Lab/GameDojo-4B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "THUSI-Lab/GameDojo-4B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "THUSI-Lab/GameDojo-4B", "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/THUSI-Lab/GameDojo-4B
- SGLang
How to use THUSI-Lab/GameDojo-4B 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 "THUSI-Lab/GameDojo-4B" \ --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": "THUSI-Lab/GameDojo-4B", "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 "THUSI-Lab/GameDojo-4B" \ --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": "THUSI-Lab/GameDojo-4B", "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 THUSI-Lab/GameDojo-4B with Docker Model Runner:
docker model run hf.co/THUSI-Lab/GameDojo-4B
Add GameDojo project teaser and credits
Browse files
README.md
CHANGED
|
@@ -21,6 +21,22 @@ tags:
|
|
| 21 |
<span style="display: inline-block; margin: 2px;"><img style="display: inline-block; vertical-align: middle; margin: 0;" src="https://img.shields.io/badge/Dataset%20%26%20Benchmark-6B7280?style=for-the-badge&logo=huggingface&logoColor=white" alt="Dataset & Benchmark (link pending)"></span>
|
| 22 |
</p>
|
| 23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
## Overview
|
| 25 |
|
| 26 |
GameDojo-4B is a vision-language model for video game boss encounters. It takes game observations and task context and generates keyboard and mouse actions for the GameDojo computer-use (CUA) interface. Each action chunk covers 200 ms of game control.
|
|
|
|
| 21 |
<span style="display: inline-block; margin: 2px;"><img style="display: inline-block; vertical-align: middle; margin: 0;" src="https://img.shields.io/badge/Dataset%20%26%20Benchmark-6B7280?style=for-the-badge&logo=huggingface&logoColor=white" alt="Dataset & Benchmark (link pending)"></span>
|
| 22 |
</p>
|
| 23 |
|
| 24 |
+
<p align="center" style="background-color: #fff; border-radius: 6px; padding: 6px 4px;">
|
| 25 |
+
<img src="https://gamedojo-benchmark.github.io/assets/img/institutions/tsinghua.jpg" alt="Tsinghua University" height="30" style="display: inline-block; vertical-align: middle; height: 30px; width: auto; margin: 5px 8px;">
|
| 26 |
+
<img src="https://gamedojo-benchmark.github.io/assets/img/institutions/ucas.png" alt="University of Chinese Academy of Sciences" height="27" style="display: inline-block; vertical-align: middle; height: 27px; width: auto; margin: 5px 8px;">
|
| 27 |
+
<img src="https://gamedojo-benchmark.github.io/assets/img/institutions/nus.jpg" alt="National University of Singapore" height="34" style="display: inline-block; vertical-align: middle; height: 34px; width: auto; margin: 5px 8px;">
|
| 28 |
+
<img src="https://gamedojo-benchmark.github.io/assets/img/institutions/hku-bilingual.svg" alt="香港大學 · The University of Hong Kong" height="24" style="display: inline-block; vertical-align: middle; height: 24px; width: auto; margin: 5px 8px;">
|
| 29 |
+
<img src="https://gamedojo-benchmark.github.io/assets/img/institutions/macau.png" alt="University of Macau" height="30" style="display: inline-block; vertical-align: middle; height: 30px; width: auto; margin: 5px 8px;">
|
| 30 |
+
</p>
|
| 31 |
+
|
| 32 |
+
<p align="center" style="line-height: 1.65; margin-bottom: 6px;"><strong><span style="white-space: nowrap;">Kuan Zhang<sup>1,*</sup>,</span> <span style="white-space: nowrap;">Zhihao Yang<sup>2,*</sup>,</span> <span style="white-space: nowrap;">Yukun Chen<sup>2,*</sup>,</span> <span style="white-space: nowrap;">Xingyiliang Yin<sup>3</sup>,</span> <span style="white-space: nowrap;">Mingyu Ouyang<sup>4</sup>,</span> <span style="white-space: nowrap;">Yue Su<sup>5</sup>,</span> <span style="white-space: nowrap;">Xiangnan Wu<sup>2</sup>,</span> <span style="white-space: nowrap;">Jiaming Li<sup>2</sup>,</span> <span style="white-space: nowrap;">Longze Chen<sup>2</sup>,</span> <span style="white-space: nowrap;">Run Luo<sup>4</sup>,</span> <span style="white-space: nowrap;">Zirong Chen<sup>1</sup>,</span> <span style="white-space: nowrap;">Lu Wang<sup>1,†</sup>,</span> <span style="white-space: nowrap;">Yiming Li<sup>1,†</sup></span></strong></p>
|
| 33 |
+
<p align="center" style="font-size: 0.9em; line-height: 1.6; margin-top: 0; margin-bottom: 4px;"><span style="display: inline-block; margin: 0 5px;"><sup>1</sup> Tsinghua University</span> <span style="display: inline-block; margin: 0 5px;"><sup>2</sup> University of the Chinese Academy of Sciences</span> <span style="display: inline-block; margin: 0 5px;"><sup>3</sup> University of Macau</span> <span style="display: inline-block; margin: 0 5px;"><sup>4</sup> National University of Singapore</span> <span style="display: inline-block; margin: 0 5px;"><sup>5</sup> University of Hong Kong</span></p>
|
| 34 |
+
<p align="center" style="font-size: 0.85em; margin-top: 0;"><span style="display: inline-block; margin: 0 5px;"><sup>*</sup> Equal contribution</span> <span style="display: inline-block; margin: 0 5px;"><sup>†</sup> Co-corresponding authors</span></p>
|
| 35 |
+
|
| 36 |
+
<p align="center">
|
| 37 |
+
<img src="https://gamedojo-benchmark.github.io/assets/img/arena.webp" alt="A lone player stands on a circular arena floor facing a semicircle of twenty golden portals; each portal holds a boss from a different game." width="100%" style="width: 100%; height: auto; max-width: 1100px; border-radius: 6px;">
|
| 38 |
+
</p>
|
| 39 |
+
|
| 40 |
## Overview
|
| 41 |
|
| 42 |
GameDojo-4B is a vision-language model for video game boss encounters. It takes game observations and task context and generates keyboard and mouse actions for the GameDojo computer-use (CUA) interface. Each action chunk covers 200 ms of game control.
|