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, dtype="auto") - Notebooks
- Google Colab
- Kaggle
metadata
license: apache-2.0
OneChart: Purify the Chart Structural Extraction via One Auxiliary Token
Jinyue Chen*, Lingyu Kong*, Haoran Wei, Chenglong Liu, Zheng Ge, Liang Zhao, Jianjian Sun, Chunrui Han, Xiangyu Zhang
Quickly try the demo using hugginface:
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)