Image-Text-to-Text
Transformers
Safetensors
English
pix2struct
chart-editing
chart-understanding
chart-derendering
deplot
document-ai
icdar2024
Instructions to use Pengyu965/ChartReformer with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Pengyu965/ChartReformer with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Pengyu965/ChartReformer")# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("Pengyu965/ChartReformer") model = AutoModelForMultimodalLM.from_pretrained("Pengyu965/ChartReformer", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Pengyu965/ChartReformer with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Pengyu965/ChartReformer" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Pengyu965/ChartReformer", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Pengyu965/ChartReformer
- SGLang
How to use Pengyu965/ChartReformer with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Pengyu965/ChartReformer" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Pengyu965/ChartReformer", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Pengyu965/ChartReformer" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Pengyu965/ChartReformer", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Pengyu965/ChartReformer with Docker Model Runner:
docker model run hf.co/Pengyu965/ChartReformer
Download train_state.json from Pengyu965/ChartReformer: direct link, hf CLI and curl.
- Browser
- Download file 509 Bytes
-
https://huggingface.co/Pengyu965/ChartReformer/resolve/main/train_state.json
- Command line
-
hf download hf://Pengyu965/ChartReformer/train_state.json
-
curl -L -o train_state.json https://huggingface.co/Pengyu965/ChartReformer/resolve/main/train_state.json
509 Bytes
| { | |
| "run_name": "finetune_new_edits_data", | |
| "max_length": 1024, | |
| "per_device_train_batch_size": 4, | |
| "per_device_eval_batch_size": 4, | |
| "gradient_accumulation_steps": 1, | |
| "learning_rate": 2e-05, | |
| "weight_decay": 1e-05, | |
| "num_warmup_steps": 500, | |
| "train_batch_size": 16, | |
| "num_train_epochs": 20, | |
| "max_steps": 387000, | |
| "checkpointing_steps": "5000", | |
| "epoch": 1, | |
| "global_step": 20000, | |
| "train_loss": 0.03977988660335541, | |
| "eval_loss": 0.05922633409500122, | |
| "current_lr": 1.9874737996766403e-05 | |
| } |