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
Commit History
Today
-
Add GameDojo Daily Paper button
Verified signaturec199d5b -
Remove URL from GameDojo BibTeX
Verified signature951cde3 -
Add GameDojo citation and related projects
Verified signatureab61d61 -
Link GameDojo paper to arXiv
Verified signature259fe97
Yesterday
-
Update README.md
Verified signature4290b0b
2 days ago
-
Match GameScaling badge colors
Verified signature3ec26a0 -
Link the THUSI-Lab GameDojo dataset
Verified signaturebbd9a9a -
Connect GameDojo repository and resource links
Verified signatureee2b921 -
Use GameScaling-style icon badges
Verified signature005acfe -
Point download and loading examples to THUSI-Lab
Verified signature6da3765 -
Apply the GameDojo website palette
Verified signaturedab7b31 -
Use the King Slime CUA prompt from the supplement
Verified signatured148074 -
Clarify the single-frame prompt provenance
Verified signature2efc0ce -
Wrap the raw CUA reply on narrow screens
Verified signatureb87e7f9 -
Document a verified GameDojo-4B single-frame inference
Verified signaturef1b0d31 -
Restore the full GameDojo project title
Verified signature02795f7 -
Use the GameDojo logo as the card header
Verified signatured71b890 -
Fit the five school logos on one line
Verified signature3b8202e -
Add GameDojo project teaser and credits
Verified signaturea814321 -
Align model card badges in one row
Verified signature9f04b07 -
Update GameDojo-4B model card
Verified signaturefb55b07 -
Use BF16 for GameDojo-4B model loading
Verified signatureb3a8367 -
Add GameDojo-4B model card
Verified signature18cc280 -
Add GameDojo-4B model weights and inference assets (#1)
- Add GameDojo-4B model weights and inference assets (0bdda65c9e95730a657392071b7d6601232e286a) Co-authored-by: Zhihao Yang <hanoiy@users.noreply.huggingface.co>1d0c7d9
3 days ago
-
initial commit
Verified signatureecdc986