Instructions to use Humayoun/Donut2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Humayoun/Donut2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Humayoun/Donut2")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("Humayoun/Donut2") model = AutoModelForMultimodalLM.from_pretrained("Humayoun/Donut2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Humayoun/Donut2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Humayoun/Donut2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Humayoun/Donut2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Humayoun/Donut2
- SGLang
How to use Humayoun/Donut2 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 "Humayoun/Donut2" \ --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": "Humayoun/Donut2", "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 "Humayoun/Donut2" \ --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": "Humayoun/Donut2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Humayoun/Donut2 with Docker Model Runner:
docker model run hf.co/Humayoun/Donut2
Commit History
-
End of training
75b8006 -
Training in progress, epoch 20
c7ea6d9 -
Training in progress, epoch 19
8da346c -
Training in progress, epoch 17
2d82a2d -
Training in progress, epoch 15
1ee1f2d -
Training in progress, epoch 14
67d5a03 -
Training in progress, epoch 12
2c21adf -
Training in progress, epoch 10
657faf9 -
Training in progress, epoch 9
21f3e2f -
Training in progress, epoch 7
b8f7701 -
Training in progress, epoch 5
5059b54 -
Training in progress, epoch 4
75a705f -
Training in progress, epoch 2
fa84ce9 -
Training in progress, epoch 1
00cb5ad -
Training in progress, epoch 4
d5d70e4 -
Training in progress, epoch 2
057df03 -
Training in progress, epoch 1
9057a04