Downloads · 30 days
3
1% of all-time downloads
justairr/SATORI
SATORI is a machine learning model from justairr. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
This is the official implementation from the paper SATORI-R1: Incentivizing Multimodal Reasoning with Spatial Grounding and Verifiable Rewards. Arxiv Here.
Downloads · 30 days
3
1% of all-time downloads
All-time downloads
332
Public
Parameters
4.1B
8.1 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors8.1 GB · 100%
From the Hugging Face model README
This is the official implementation from the paper SATORI-R1: Incentivizing Multimodal Reasoning with Spatial Grounding and Verifiable Rewards. Arxiv Here.
SATORI is a vision-language model fine-tuned from Qwen2.5-VL to perform structured visual reasoning for Visual Question Answering (VQA). It generates:
from transformers import Qwen2_5_VLForConditionalGeneration, AutoTokenizer, AutoProcessor
from qwen_vl_utils import process_vision_info
# Load the SATORI model and processor
model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
"justairr/SATORI", torch_dtype="auto", device_map="auto"
)
min_pixels = 256 * 28 * 28
max_pixels = 512 * 28 * 28
processor = AutoProcessor.from_pretrained(
"justairr/SATORI", min_pixels=min_pixels, max_pixels=max_pixels
)
# Chat-style messages guiding structured output
messages = [
{
"role": "system",
"content": (
"Given an image and a question, follow these steps:\n"
"1. Generate a brief image caption describing the overall scene inside <caption>...</caption>.\n"
"2. Determine the most relevant image regions, output their coordinates inside <bbox>...</bbox>.\n"
"3. Provide the final answer inside <answer>...</answer>."
),
},
{
"role": "user",
"content": [
{
"type": "image",
"image": "https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-VL/assets/demo.jpeg",
},
{
"type": "text",
"text": (
"What's the girl playing with?\n"
"First, provide an image caption inside <caption>...</caption>, "
"then bounding boxes inside <bbox>...</bbox>, and finally <answer>...</answer>."
),
},
],
},
]
# Prepare inputs
text = processor.apply_chat_template(
messages, tokenize=False, add_generation_prompt=True
)
image_inputs, video_inputs = process_vision_info(messages)
inputs = processor(
text=[text],
images=image_inputs,
videos=video_inputs,
padding=True,
return_tensors="pt",
).to("cuda")
# Generate output
generated_ids = model.generate(**inputs, max_new_tokens=128)
trimmed = [out[len(inp):] for inp, out in zip(inputs.input_ids, generated_ids)]
output_text = processor.batch_decode(
trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False
)
print(output_text)