Instructions to use Gastpm/Donut_V2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Gastpm/Donut_V2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Gastpm/Donut_V2")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("Gastpm/Donut_V2") model = AutoModelForMultimodalLM.from_pretrained("Gastpm/Donut_V2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Gastpm/Donut_V2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Gastpm/Donut_V2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Gastpm/Donut_V2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Gastpm/Donut_V2
- SGLang
How to use Gastpm/Donut_V2 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 "Gastpm/Donut_V2" \ --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": "Gastpm/Donut_V2", "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 "Gastpm/Donut_V2" \ --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": "Gastpm/Donut_V2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Gastpm/Donut_V2 with Docker Model Runner:
docker model run hf.co/Gastpm/Donut_V2
Commit History
-
Training in progress, epoch 14
e989799 -
Training in progress, epoch 13
f7bf581 -
Training in progress, epoch 12
dc21dba -
Training in progress, epoch 11
c4b7366 -
Training in progress, epoch 10
502b0bb -
Training in progress, epoch 9
17b8599 -
Training in progress, epoch 8
28b8ff2 -
Training in progress, epoch 7
221e5b0 -
Training in progress, epoch 6
eab1420 -
Training in progress, epoch 5
7c0cc62 -
Training in progress, epoch 4
f0ccd97 -
Training in progress, epoch 3
0884dce -
Training in progress, epoch 2
c6e74aa -
Training in progress, epoch 1
380938d -
Training in progress, epoch 0
64bda12 -
initial commit
d2e5589