Instructions to use nielsr/donut-demo with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nielsr/donut-demo with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="nielsr/donut-demo")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("nielsr/donut-demo") model = AutoModelForMultimodalLM.from_pretrained("nielsr/donut-demo", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use nielsr/donut-demo with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "nielsr/donut-demo" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nielsr/donut-demo", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/nielsr/donut-demo
- SGLang
How to use nielsr/donut-demo 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 "nielsr/donut-demo" \ --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": "nielsr/donut-demo", "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 "nielsr/donut-demo" \ --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": "nielsr/donut-demo", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use nielsr/donut-demo with Docker Model Runner:
docker model run hf.co/nielsr/donut-demo
Commit History
-
Training in progress, epoch 3
4dccac9 -
Training in progress, epoch 2
0b6d2ca -
Training in progress, epoch 1
eaa9768 -
Training in progress, epoch 0
8219d1f
-
Training in progress, epoch 29
09864b3 -
Training in progress, epoch 28
83f4b9f -
Training in progress, epoch 27
f972305 -
Training in progress, epoch 26
4bb7660 -
Training in progress, epoch 25
ad67237 -
Training in progress, epoch 24
d52fe49 -
Training in progress, epoch 23
9948fac -
Training in progress, epoch 22
85f6311 -
Training in progress, epoch 21
814a956 -
Training in progress, epoch 20
6140c7b -
Training in progress, epoch 19
a1a1a8b -
Training in progress, epoch 18
fe34e59 -
Training in progress, epoch 17
ec4dc58 -
Training in progress, epoch 16
a571b85 -
Training in progress, epoch 15
05ec054 -
Training in progress, epoch 14
382e43d -
Training in progress, epoch 13
998a4d3 -
Training in progress, epoch 12
c25a760 -
Training in progress, epoch 11
949dc03 -
Training in progress, epoch 10
f64952f -
Training in progress, epoch 9
ea42669 -
Training in progress, epoch 8
a06fe28 -
Training in progress, epoch 7
12bb61c -
Training in progress, epoch 6
c07712a -
Training in progress, epoch 5
03a568f -
Training in progress, epoch 4
00fafc5 -
Training in progress, epoch 3
f587ac8 -
Training in progress, epoch 2
09c1112 -
Training in progress, epoch 1
58458e3 -
Training in progress, epoch 0
363ef87 -
Training in progress, epoch 4
98a51a9 -
Training in progress, epoch 3
48d434c -
Training in progress, epoch 2
3a36321 -
Training in progress, epoch 1
8cecf45 -
Training in progress, epoch 0
84aba25