ChartLlama 技术文档
ChartLlama-code 项目地址: https://gitcode.com/gh_mirrors/ch/ChartLlama-code
1. 安装指南
环境要求
- Python 3.8.5 或更高版本
- CUDA 11.0 或更高版本(推荐)
安装步骤
-
克隆项目仓库:
git clone https://github.com/tingxueronghua/ChartLlama-code.git cd ChartLlama-code
-
安装依赖:
pip install -e .
2. 项目使用说明
项目简介
ChartLlama 是一个多模态大语言模型,专门用于图表理解和生成。它通过一个数据生成管道创建指令调优数据集,并在该数据集上训练模型,以实现图表重绘和编辑等能力。
功能示例
- 图表重绘:根据给定的图表进行重绘。
- 图表编辑:根据指令编辑图表。
- 新图表绘制:根据给定的原始数据和指令绘制新图表。
3. 项目API使用文档
推理API
使用 model_vqa_lora
模块进行推理。以下是一个示例命令:
CUDA_VISIBLE_DEVICES=1 python -m llava.eval.model_vqa_lora --model-path /your_path_to/LLaVA/checkpoints/${output_name} \
--question-file /your_path_to/question.json \
--image-folder ./playground/data/ \
--answers-file ./playground/data/ans.jsonl \
--num-chunks $CHUNKS \
--chunk-idx $IDX \
--temperature 0 \
--conv-mode vicuna_v1 &
参数说明
--model-path
:模型路径。--question-file
:包含所有问题的JSON文件路径。--image-folder
:包含所有图像的文件夹路径。--answers-file
:输出文件名。--num-chunks
:分块数量。--chunk-idx
:当前分块索引。--temperature
:温度参数。--conv-mode
:对话模式。
4. 项目安装方式
通过 pip 安装
pip install -e .
通过 Anaconda 安装(推荐)
conda create -n chartllama python=3.8.5
conda activate chartllama
pip install -r requirements.txt
5. 未来计划
- 创建并开源一个新的中文图表数据集。
- 开源训练脚本和数据集。
- 开源评估脚本。
- 开源评估数据集。
6. 引用
@misc{han2023chartllama,
title={ChartLlama: A Multimodal LLM for Chart Understanding and Generation},
author={Yucheng Han and Chi Zhang and Xin Chen and Xu Yang and Zhibin Wang and Gang Yu and Bin Fu and Hanwang Zhang},
year={2023},
eprint={2311.16483},
archivePrefix={arXiv},
primaryClass={cs.CV}
}
7. 免责声明
本仓库仅用于研究目的,因此只能用于个人/研究/非商业用途。
ChartLlama-code 项目地址: https://gitcode.com/gh_mirrors/ch/ChartLlama-code
创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考