Views
No views yet


1from transformers import Qwen3VLForConditionalGeneration, AutoProcessor
2from qwen_vl_utils import process_vision_info
3from PIL import Image
4
5# 1. Load Model
6model_path = "opendatalab/ChartVerse-4B"
7model = Qwen3VLForConditionalGeneration.from_pretrained(
8 model_path, torch_dtype="auto", device_map="auto"
9)
10processor = AutoProcessor.from_pretrained(model_path)
11
12# 2. Prepare Input
13image_path = "path/to/your/chart.png"
14query = "Which region demonstrates the greatest proportional variation in annual revenue compared to its typical revenue level?"
15
16messages = [
17 {
18 "role": "user",
19 "content": [
20 {"type": "image", "image": image_path},
21 {"type": "text", "text": query},
22 ],
23 }
24]
25
26# 3. Inference
27text = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
28image_inputs, video_inputs = process_vision_info(messages)
29inputs = processor(
30 text=[text],
31 images=image_inputs,
32 padding=True,
33 return_tensors="pt",
34).to("cuda")
35generated_ids = model.generate(**inputs, max_new_tokens=16384)
36output_text = processor.batch_decode(
37 generated_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False
38)
39print(output_text[0])1@misc{liu2026chartversescalingchartreasoning,
2 title={ChartVerse: Scaling Chart Reasoning via Reliable Programmatic Synthesis from Scratch},
3 author={Zheng Liu and Honglin Lin and Chonghan Qin and Xiaoyang Wang and Xin Gao and Yu Li and Mengzhang Cai and Yun Zhu and Zhanping Zhong and Qizhi Pei and Zhuoshi Pan and Xiaoran Shang and Bin Cui and Conghui He and Wentao Zhang and Lijun Wu},
4 year={2026},
5 eprint={2601.13606},
6 archivePrefix={arXiv},
7 primaryClass={cs.CV},
8 url={https://arxiv.org/abs/2601.13606},
9}