Official codebase for “ChartGen: Scaling Chart Understanding via Code-Guided Synthetic Chart Generation”
ChartGen is a two-stage, fully-automated pipeline that
| Stage | Model | What it does | Output |
|---|---|---|---|
| Reconstruct | microsoft/Phi-3.5-vision-instruct | Converts each seed chart image into plotting code enclosed in triple-backtick fences | train_generated_codes/*.md |
| Augment | mistralai/Codestral-22B-v0.1 | Produces K stylistically diverse code variants (new chart type, library, color, data) | train_augmented_codes/*.md |
ChartGen/ ├── chartgen/ │ ├── chart2code.py # stage-1 script (image → code) │ ├── code_augment.py # stage-2 script (code → diversified code) │ └── extract_plot.py # utils: extract code & render charts from raw model output ├── README.md ├── LICENSE └── requirements.txt # pinned dependency versions
# 1 Clone the repo
git clone https://github.com/<your-handle>/ChartGen.git
cd ChartGen
# 2 Create and activate an isolated environment
python -m venv .venv && source .venv/bin/activate # macOS / Linux
# .\.venv\Scripts\Activate.ps1 # Windows PowerShell
# 3 Install *GPU* or *CPU* wheels for PyTorch first
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu118 # CUDA 11.8
# pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu # CPU-only
# 4 Install the remaining Python packages
pip install -r requirements.txt
# 5 Authenticate with Hugging Face (needed for Codestral)
huggingface-cli login # or: export HF_TOKEN=hf_your_token
This work is licensed under a Creative Commons Attribution 4.0 International License.
Official codebase for “ChartGen: Scaling Chart Understanding via Code-Guided Synthetic Chart Generation”
ChartGen is a two-stage, fully-automated pipeline that
| Stage | Model | What it does | Output |
|---|---|---|---|
| Reconstruct | microsoft/Phi-3.5-vision-instruct | Converts each seed chart image into plotting code enclosed in triple-backtick fences | train_generated_codes/*.md |
| Augment | mistralai/Codestral-22B-v0.1 | Produces K stylistically diverse code variants (new chart type, library, color, data) | train_augmented_codes/*.md |
ChartGen/ ├── chartgen/ │ ├── chart2code.py # stage-1 script (image → code) │ ├── code_augment.py # stage-2 script (code → diversified code) │ └── extract_plot.py # utils: extract code & render charts from raw model output ├── README.md ├── LICENSE └── requirements.txt # pinned dependency versions
# 1 Clone the repo
git clone https://github.com/<your-handle>/ChartGen.git
cd ChartGen
# 2 Create and activate an isolated environment
python -m venv .venv && source .venv/bin/activate # macOS / Linux
# .\.venv\Scripts\Activate.ps1 # Windows PowerShell
# 3 Install *GPU* or *CPU* wheels for PyTorch first
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu118 # CUDA 11.8
# pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu # CPU-only
# 4 Install the remaining Python packages
pip install -r requirements.txt
# 5 Authenticate with Hugging Face (needed for Codestral)
huggingface-cli login # or: export HF_TOKEN=hf_your_token
This work is licensed under a Creative Commons Attribution 4.0 International License.