Views
No views yet

Spatial-SSRL-Qwen3VL-4B-FP8 is an FP8-compressed variant built on top of internlm/Spatial-SSRL-Qwen3VL-4B. This edition applies BF16 · FP8 (F8_E4M3) precision formats to reduce memory footprint and increase inference throughput, while preserving the spatial reasoning and multimodal understanding strengths of the original 4B architecture.The base Spatial-SSRL-Qwen3VL-4B model is a spatially enhanced vision-language model built upon Qwen3-VL-4B-Instruct. It integrates Spatial-SSRL, a lightweight self-supervised reinforcement learning paradigm designed to scale RLVR efficiently. The model demonstrates strong spatial intelligence while maintaining the original general visual capabilities of its base architecture.
1from transformers import Qwen3VLForConditionalGeneration, AutoProcessor
2from qwen_vl_utils import process_vision_info
3import torch
4
5# Load the Spatial SSRL Qwen3VL 4B FP8 model
6model = Qwen3VLForConditionalGeneration.from_pretrained(
7 "internlm/Spatial-SSRL-Qwen3VL-4B-FP8",
8 torch_dtype="auto",
9 device_map="auto"
10)
11
12processor = AutoProcessor.from_pretrained(
13 "internlm/Spatial-SSRL-Qwen3VL-4B-FP8"
14)
15
16messages = [
17 {
18 "role": "user",
19 "content": [
20 {
21 "type": "image",
22 "image": "sample_image.png",
23 },
24 {
25 "type": "text",
26 "text": "Describe spatial relationships between objects and explain their relative positions."
27 },
28 ],
29 }
30]
31
32text = processor.apply_chat_template(
33 messages, tokenize=False, add_generation_prompt=True
34)
35
36image_inputs, video_inputs = process_vision_info(messages)
37
38inputs = processor(
39 text=[text],
40 images=image_inputs,
41 videos=video_inputs,
42 padding=True,
43 return_tensors="pt",
44).to("cuda")
45
46generated_ids = model.generate(**inputs, max_new_tokens=1024)
47
48generated_ids_trimmed = [
49 out_ids[len(in_ids):] for in_ids, out_ids in zip(inputs.input_ids, generated_ids)
50]
51
52output_text = processor.batch_decode(
53 generated_ids_trimmed,
54 skip_special_tokens=True,
55 clean_up_tokenization_spaces=False
56)
57
58print(output_text)Note: This model focuses on spatial reasoning and multimodal understanding.