Instructions to use game2player/Game2Player-4B-Thinking with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use game2player/Game2Player-4B-Thinking with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="game2player/Game2Player-4B-Thinking") 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("game2player/Game2Player-4B-Thinking") model = AutoModelForMultimodalLM.from_pretrained("game2player/Game2Player-4B-Thinking", 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 game2player/Game2Player-4B-Thinking with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "game2player/Game2Player-4B-Thinking" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "game2player/Game2Player-4B-Thinking", "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/game2player/Game2Player-4B-Thinking
- SGLang
How to use game2player/Game2Player-4B-Thinking 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 "game2player/Game2Player-4B-Thinking" \ --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": "game2player/Game2Player-4B-Thinking", "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 "game2player/Game2Player-4B-Thinking" \ --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": "game2player/Game2Player-4B-Thinking", "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 game2player/Game2Player-4B-Thinking with Docker Model Runner:
docker model run hf.co/game2player/Game2Player-4B-Thinking
|
Download README.md from game2player/Game2Player-4B-Thinking: direct link, hf CLI and curl.
- Browser
- Download file 1.77 kB
-
https://huggingface.co/game2player/Game2Player-4B-Thinking/resolve/main/README.md
- Command line
-
hf download hf://game2player/Game2Player-4B-Thinking/README.md
-
curl -L -H "Authorization: Bearer $HF_TOKEN" -o README.md https://huggingface.co/game2player/Game2Player-4B-Thinking/resolve/main/README.md
1.77 kB
| license: apache-2.0 | |
| base_model: Qwen/Qwen3.5-4B | |
| base_model_relation: finetune | |
| library_name: transformers | |
| pipeline_tag: image-text-to-text | |
| tags: | |
| - game2player | |
| - sft | |
| - thinking | |
| # Game2Player-4B-Thinking | |
| Final checkpoint after one epoch of SFT on game examples containing nonempty | |
| assistant thinking blocks. Training mixes **DeepSeek and MiniMax** data: | |
| 14,336 selected DeepSeek-v4.1-flash records and 8,138 MiniMax-m3.1-flash records. | |
| After preprocessing, 22,425 records remain (49 filtered). This is not a | |
| DeepSeek-only model. Final training step: 157. | |
| Full language-model fine-tuning with vision encoder and aligner frozen; | |
| 4 H200 GPUs, BF16, ZeRO-2, gradient checkpointing, 25K packing, | |
| global batch 48, LR 1e-5, cosine schedule, 3% warmup, seed 3407. | |
| Base revision: `851bf6e806efd8d0a36b00ddf55e13ccb7b8cd0a`. | |
| The 4B run completed one epoch without recorded overflow warnings. | |
| No downstream benchmark evaluation has been performed. | |
| The repository contains inference weights and all tokenizer/processor assets, | |
| including supplemental base tokenizer/video assets where absent from the | |
| checkpoint. Optimizer states, RNG states, training data and images are not | |
| included. Full training checkpoints remain stored locally. | |
| See `training_summary.json` for provenance. | |
| Load using a Transformers version supporting Qwen3.5 (the training environment | |
| uses Transformers 5.16.1). Authenticate with an account authorized for this | |
| private repository. | |
| ```python | |
| import torch | |
| from transformers import AutoProcessor, Qwen3_5ForConditionalGeneration | |
| model_id = "game2player/Game2Player-4B-Thinking" | |
| processor = AutoProcessor.from_pretrained(model_id) | |
| model = Qwen3_5ForConditionalGeneration.from_pretrained( | |
| model_id, dtype=torch.bfloat16, device_map="auto" | |
| ) | |
| ``` | |