Views
No views yet

KAIROS-MM-Qwen2.5-VL-7B-SFT is a multimodal reasoning model based on Qwen2.5-VL, designed to enable robots and vision AI agents to reason about the real world using physics understanding, prior knowledge, and common sense. The model understands space, time, and fundamental physical principles, and is well suited for planning, decision making, and long horizon video reasoning in embodied and agentic systems. It serves as a planning and reasoning backbone for embodied agents, allowing them to infer what actions to take next based on visual observations, temporal context, and physical constraints.
1from transformers import Qwen2_5_VLForConditionalGeneration, AutoProcessor
2from qwen_vl_utils import process_vision_info
3
4model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
5 "prithivMLmods/KAIROS-MM-Qwen2.5-VL-7B-SFT",
6 torch_dtype="auto",
7 device_map="auto"
8)
9
10processor = AutoProcessor.from_pretrained(
11 "prithivMLmods/KAIROS-MM-Qwen2.5-VL-7B-SFT"
12)
13
14messages = [
15 {
16 "role": "user",
17 "content": [
18 {"type": "video", "video": "<LONG_HORIZON_VIDEO>"},
19 {"type": "text", "text": "What should the robot do next to safely pick up the object?"},
20 ],
21 }
22]
23
24text = processor.apply_chat_template(
25 messages,
26 tokenize=False,
27 add_generation_prompt=True
28)
29
30image_inputs, video_inputs = process_vision_info(messages)
31
32inputs = processor(
33 text=[text],
34 images=image_inputs,
35 videos=video_inputs,
36 padding=True,
37 return_tensors="pt",
38)
39inputs = inputs.to("cuda")
40
41generated_ids = model.generate(**inputs, max_new_tokens=1024)
42generated_ids_trimmed = [
43 out_ids[len(in_ids):] for in_ids, out_ids in zip(inputs.input_ids, generated_ids)
44]
45
46output_text = processor.batch_decode(
47 generated_ids_trimmed,
48 skip_special_tokens=True,
49 clean_up_tokenization_spaces=False,
50)
51print(output_text)