MLL-Lab/MindCube
Viewer • Updated • 4.28k • 653 • 10
How to use Inevitablevalor/MindCube-plain-cgmap-ffr-out-ckpt57 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("image-text-to-text", model="Inevitablevalor/MindCube-plain-cgmap-ffr-out-ckpt57")
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 AutoProcessor, AutoModelForMultimodalLM
processor = AutoProcessor.from_pretrained("Inevitablevalor/MindCube-plain-cgmap-ffr-out-ckpt57")
model = AutoModelForMultimodalLM.from_pretrained("Inevitablevalor/MindCube-plain-cgmap-ffr-out-ckpt57", 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=40)
print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:]))How to use Inevitablevalor/MindCube-plain-cgmap-ffr-out-ckpt57 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "Inevitablevalor/MindCube-plain-cgmap-ffr-out-ckpt57"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "Inevitablevalor/MindCube-plain-cgmap-ffr-out-ckpt57",
"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 run hf.co/Inevitablevalor/MindCube-plain-cgmap-ffr-out-ckpt57
How to use Inevitablevalor/MindCube-plain-cgmap-ffr-out-ckpt57 with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "Inevitablevalor/MindCube-plain-cgmap-ffr-out-ckpt57" \
--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": "Inevitablevalor/MindCube-plain-cgmap-ffr-out-ckpt57",
"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 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 "Inevitablevalor/MindCube-plain-cgmap-ffr-out-ckpt57" \
--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": "Inevitablevalor/MindCube-plain-cgmap-ffr-out-ckpt57",
"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"
}
}
]
}
]
}'How to use Inevitablevalor/MindCube-plain-cgmap-ffr-out-ckpt57 with Docker Model Runner:
docker model run hf.co/Inevitablevalor/MindCube-plain-cgmap-ffr-out-ckpt57
Full-parameter SFT of Qwen/Qwen2.5-VL-3B-Instruct on the plain_cgmap_ffr_out
setting of MindCube: the model first emits a
plain cognitive map of the scene, then free-form reasoning, then the answer.
This repo holds the checkpoint-57 snapshot of that run.
| Base model | Qwen/Qwen2.5-VL-3B-Instruct |
| Task / dataset | plain_cgmap_ffr_out |
| Learning rate | 1e-5 |
| Epochs | 3 |
| Max sequence length | 8192 |
| Image pixels | min 784 / max 90000 |
| Precision | bfloat16 |
from transformers import Qwen2_5_VLForConditionalGeneration, AutoProcessor
model_id = "Inevitablevalor/MindCube-plain-cgmap-ffr-out-ckpt57"
model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
model_id, torch_dtype="bfloat16", device_map="auto"
)
processor = AutoProcessor.from_pretrained(model_id, min_pixels=784, max_pixels=90000)
Inference follows the standard Qwen2.5-VL multi-image chat format; see the MindCube repo for the exact prompts and evaluation scripts used for this setting.
@article{yin2025mindcube,
title = {Spatial Mental Modeling from Limited Views},
author = {Yin, Baiqiao and Wang, Qineng and Zhang, Pingyue and Zhang, Jianshu and
Wang, Kangrui and Wang, Zihan and Zhang, Jieyu and Chandrasegaran, Keshigeyan and
Liu, Han and Krishna, Ranjay and Xie, Saining and Li, Manling and
Wu, Jiajun and Fei-Fei, Li},
journal = {arXiv preprint arXiv:2506.21458},
year = {2025}
}
Base model
Qwen/Qwen2.5-VL-3B-Instruct