Views
No views yet

transformers.1import torch
2from transformers import AutoProcessor, AutoModelForCausalLM
3from qwen_vl_utils import process_vision_info
4
5model_path = "InnovatorLab/Innovator-VL-8B-Instruct"
6
7# Load the model on the available device(s)
8model = AutoModelForCausalLM.from_pretrained(
9 model_path,
10 torch_dtype="auto",
11 device_map="auto",
12 trust_remote_code=True,
13)
14
15# Load processor
16processor = AutoProcessor.from_pretrained(
17 model_path,
18 trust_remote_code=True,
19)
20
21messages = [
22 {
23 "role": "user",
24 "content": [
25 {
26 "type": "image",
27 "image": "https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-VL/assets/demo.jpeg",
28 },
29 {"type": "text", "text": "Describe this image."},
30 ],
31 }
32]
33
34# Preparation for inference
35text = processor.apply_chat_template(
36 messages,
37 tokenize=False,
38 add_generation_prompt=True,
39)
40
41image_inputs, video_inputs = process_vision_info(messages)
42
43inputs = processor(
44 text=[text],
45 images=image_inputs,
46 videos=video_inputs,
47 padding=True,
48 return_tensors="pt",
49)
50
51# Move inputs to GPU (optional)
52inputs = inputs.to("cuda")
53
54# Inference: Generation of the output
55generated_ids = model.generate(**inputs, max_new_tokens=1024)
56
57generated_ids_trimmed = [
58 out_ids[len(in_ids):] for in_ids, out_ids in zip(inputs.input_ids, generated_ids)
59]
60
61output_text = processor.batch_decode(
62 generated_ids_trimmed,
63 skip_special_tokens=True,
64 clean_up_tokenization_spaces=False,
65)
66
67print(output_text)1@article{wen2026innovator,
2 title={Innovator-VL: A Multimodal Large Language Model for Scientific Discovery},
3 author={Wen, Zichen and Yang, Boxue and Chen, Shuang and Zhang, Yaojie and Han, Yuhang and Ke, Junlong and Wang, Cong and others},
4 journal={arXiv preprint arXiv:2601.19325},
5 year={2026}
6}