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
Fit the five school logos on one line
Browse files
README.md
CHANGED
|
@@ -22,11 +22,11 @@ tags:
|
|
| 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
|
| 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
|
| 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
|
| 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
|
| 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
|
| 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>
|
|
|
|
| 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 5px;">
|
| 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 5px;">
|
| 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 5px;">
|
| 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 5px;">
|
| 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 5px;">
|
| 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>
|