Instructions to use kppkkp/OneChart with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use kppkkp/OneChart with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="kppkkp/OneChart", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("kppkkp/OneChart", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
| license: apache-2.0 | |
| <h1><a href="https://github.com/LingyvKong/OneChart">OneChart: Purify the Chart Structural Extraction via One Auxiliary Token</a></h1> | |
| Jinyue Chen*, Lingyu Kong*, [Haoran Wei](https://scholar.google.com/citations?user=J4naK0MAAAAJ&hl=en), Chenglong Liu, [Zheng Ge](https://joker316701882.github.io/), Liang Zhao, [Jianjian Sun](https://scholar.google.com/citations?user=MVZrGkYAAAAJ&hl=en), Chunrui Han, [Xiangyu Zhang](https://scholar.google.com/citations?user=yuB-cfoAAAAJ&hl=en) | |
| [Github](https://github.com/LingyvKong/OneChart) | |
| [arxiv](https://arxiv.org/abs/2404.09987) | |
| ## Quickly try the demo using hugginface: | |
| ```python | |
| from transformers import AutoModel, AutoTokenizer | |
| tokenizer = AutoTokenizer.from_pretrained('kppkkp/OneChart', trust_remote_code=True, use_fast=False, padding_side="right") | |
| model = AutoModel.from_pretrained('kppkkp/OneChart', trust_remote_code=True, low_cpu_mem_usage=True, device_map='cuda') | |
| model = model.eval().cuda() | |
| # input your test image | |
| image_file = 'image.png' | |
| res = model.chat(tokenizer, image_file, reliable_check=True) | |
| print(res) | |
| ``` |