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
Training done
#32 opened about 3 years ago
by
DeepeshAlwani
Training in progress, epoch 11
#31 opened about 3 years ago
by
DeepeshAlwani
Training in progress, epoch 10
#30 opened about 3 years ago
by
DeepeshAlwani
Training in progress, epoch 9
#29 opened about 3 years ago
by
DeepeshAlwani
Training in progress, epoch 8
#28 opened about 3 years ago
by
DeepeshAlwani
Training in progress, epoch 7
#27 opened about 3 years ago
by
DeepeshAlwani
Training in progress, epoch 6
#26 opened about 3 years ago
by
DeepeshAlwani
Training in progress, epoch 5
#25 opened about 3 years ago
by
DeepeshAlwani
Training in progress, epoch 4
#24 opened about 3 years ago
by
DeepeshAlwani
Training in progress, epoch 3
#23 opened about 3 years ago
by
DeepeshAlwani
Training in progress, epoch 2
#22 opened about 3 years ago
by
DeepeshAlwani
Training in progress, epoch 1
#21 opened about 3 years ago
by
DeepeshAlwani
Training in progress, epoch 0
#20 opened about 3 years ago
by
DeepeshAlwani
Training done
#19 opened about 3 years ago
by
chaine09
Training done
#18 opened about 3 years ago
by
chaine09
Training in progress, epoch 2
#17 opened about 3 years ago
by
chaine09
Training in progress, epoch 1
#16 opened about 3 years ago
by
chaine09
Training in progress, epoch 0
#15 opened about 3 years ago
by
chaine09
Training in progress, epoch 1
#14 opened about 3 years ago
by
Agni0398
Training in progress, epoch 0
#13 opened about 3 years ago
by
Agni0398
Training in progress, epoch 0
#12 opened about 3 years ago
by
Agni0398
Training in progress, epoch 0
#11 opened about 3 years ago
by
Agni0398
Training in progress, epoch 0
#10 opened about 3 years ago
by
Agni0398
Training done
#9 opened about 3 years ago
by
orangeclick
Training done
#8 opened about 3 years ago
by
orangeclick
Training in progress, epoch 1
#7 opened about 3 years ago
by
orangeclick
Training in progress, epoch 0
#6 opened about 3 years ago
by
orangeclick
Training done
#5 opened over 3 years ago
by
jmnferreira
Training done
#4 opened over 3 years ago
by
jmnferreira
Training in progress, epoch 0
#2 opened over 3 years ago
by
yashs252