You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mixture of Diversely Aligned Expert Connector for Chart Understanding
Zhengzhuo Xu1,2*, Bowen Qu1,3*, Yiyan Qi1*, Sinan Du2, Chengjin Xu1, Chun Yuan2, Jian Guo1,4
1 International Digital Economy Academy (IDEA),
2 Tsinghua University,
3 Peking University,
4 Hong Kong University of Science and Technology, Guangzhou
ICLR 2025 Oral
(* equal contribution)
If you have any question, feel free to contact ๐ง.
ChartMoE is a multimodal large language model with Mixture-of-Expert connector for advanced chart 1)understanding, 2)replot, 3)editing, 4)highlighting and 5)transformation.
News
2025.3.6: A reproduction of diversely aligned moe-connector is released at ๐คHF Link.
2025.2.16: ChartMoE-Data has been released at ๐ค. Please download it according to our instruction.
2025.2.15: Training codes and recipes are released! Please refer to ๐!
2025.2.11: ๐๐๐ ChartMoE is selected as ICLR2025 Oral(1.8%)!
2025.1.23: ๐๐๐ ChartMoE is accepted by ICLR2025!
๐คChartMoE Data has been released! You can download it by running:
cd chartmoe/train
python scripts/chartmoe_data_download.py
Datasets will appear at chartmoe/train/data.
Then, please unzip these two files.
unzip ChartMoE-Align.zip
unzip SFT.zip
Additionally, I want to announce that the ChartY_replot in ChartMoE-Align contains data with higher quality and bilingual texts! It may be a good choice to sample more from ChartY_replot.
Installation
Step 1. Create a conda environment and activate it.
Flash-Attn can bring ~30% accleration on training and ~20% on evaluation in our experiments.
p.s.: If you cannot install flash-attn, please set attn_implementation to eager in ChartMoE's config.json.
Quick Start
Huggingface Download Script of ChartMoE
Note: I've supported flash-attn for ChartMoE on Feb. 15. If you download chartmoe before this date, you can re-download it for acceleration.
Run:
cd chartmoe/train
python scripts/chartmoe_download.py
Then, ChartMoE will appear at chartmoe/train/ckpt/chartmoe.
Customize the weight path of ChartMoE
Set your own ChartMoE_HF_PATH. I suggest to use the absolute path of chartmoe/train/ckpt/chartmoe.
Code Demo
fromchartmoeimportChartMoE_Robotimporttorchrobot=ChartMoE_Robot()
image_path="examples/bar2.png"question="Redraw the chart with python matplotlib, giving the code to highlight the column corresponding to the year in which the student got the highest score (painting it red). Please keep the same colors and legend as the input chart."history=""withtorch.cuda.amp.autocast():
response, history=robot.chat(image_path=image_path, question=question, history=history)
print(response)
A1: Please degrade your transformers according to requiresments.txt.
Acknowledgement
Thanks to InternLM-XComposer2 and CuMo for their releases of model weights and source codes! And thanks to MMC and ChartGemma for their releases of the high-quality instruction-tuning data!
Citation
If you find our idea or code inspiring, please cite our paper:
@article{ChartMoE,
title={ChartMoE: Mixture of Diversely Aligned Expert Connector for Chart Understanding},
author={Zhengzhuo Xu and Bowen Qu and Yiyan Qi and Sinan Du and Chengjin Xu and Chun Yuan and Jian Guo},
journal={ArXiv},
year={2024},
volume={abs/2409.03277},
}
This code is partially based on ChartBench, if you use our code, please also cite๏ผ
@article{ChartBench,
title={ChartBench: A Benchmark for Complex Visual Reasoning in Charts},
author={Zhengzhuo Xu and Sinan Du and Yiyan Qi and Chengjin Xu and Chun Yuan and Jian Guo},
journal={ArXiv},
year={2023},
volume={abs/2312.15915},
}
About
[ICLR2025 Oral] ChartMoE: Mixture of Diversely Aligned Expert Connector for Chart Understanding