Instructions to use TotallyNotRust/donut with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TotallyNotRust/donut with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="TotallyNotRust/donut")# Load model directly from transformers import AutoTokenizer, AutoModelForImageTextToText tokenizer = AutoTokenizer.from_pretrained("TotallyNotRust/donut") model = AutoModelForImageTextToText.from_pretrained("TotallyNotRust/donut") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use TotallyNotRust/donut with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "TotallyNotRust/donut" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TotallyNotRust/donut", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/TotallyNotRust/donut
- SGLang
How to use TotallyNotRust/donut 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 "TotallyNotRust/donut" \ --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": "TotallyNotRust/donut", "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 "TotallyNotRust/donut" \ --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": "TotallyNotRust/donut", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use TotallyNotRust/donut with Docker Model Runner:
docker model run hf.co/TotallyNotRust/donut
| { | |
| "</s_cashprice>": 57550, | |
| "</s_changeprice>": 57552, | |
| "</s_cnt>": 57530, | |
| "</s_creditcardprice>": 57564, | |
| "</s_discount_price>": 57558, | |
| "</s_discountprice>": 57568, | |
| "</s_emoneyprice>": 57570, | |
| "</s_etc>": 57542, | |
| "</s_itemsubtotal>": 57578, | |
| "</s_menu>": 57526, | |
| "</s_menuqty_cnt>": 57556, | |
| "</s_menutype_cnt>": 57554, | |
| "</s_nm>": 57528, | |
| "</s_num>": 57566, | |
| "</s_othersvc_price>": 57574, | |
| "</s_price>": 57532, | |
| "</s_service_price>": 57538, | |
| "</s_sub>": 57548, | |
| "</s_sub_total>": 57534, | |
| "</s_subtotal_price>": 57536, | |
| "</s_tax_price>": 57540, | |
| "</s_total>": 57544, | |
| "</s_total_etc>": 57562, | |
| "</s_total_price>": 57546, | |
| "</s_unitprice>": 57560, | |
| "</s_vatyn>": 57576, | |
| "</s_void_menu>": 57572, | |
| "<s_cashprice>": 57549, | |
| "<s_changeprice>": 57551, | |
| "<s_cnt>": 57529, | |
| "<s_cord-v2>": 57579, | |
| "<s_creditcardprice>": 57563, | |
| "<s_discount_price>": 57557, | |
| "<s_discountprice>": 57567, | |
| "<s_emoneyprice>": 57569, | |
| "<s_etc>": 57541, | |
| "<s_iitcdip>": 57523, | |
| "<s_itemsubtotal>": 57577, | |
| "<s_menu>": 57525, | |
| "<s_menuqty_cnt>": 57555, | |
| "<s_menutype_cnt>": 57553, | |
| "<s_nm>": 57527, | |
| "<s_num>": 57565, | |
| "<s_othersvc_price>": 57573, | |
| "<s_price>": 57531, | |
| "<s_service_price>": 57537, | |
| "<s_sub>": 57547, | |
| "<s_sub_total>": 57533, | |
| "<s_subtotal_price>": 57535, | |
| "<s_synthdog>": 57524, | |
| "<s_tax_price>": 57539, | |
| "<s_total>": 57543, | |
| "<s_total_etc>": 57561, | |
| "<s_total_price>": 57545, | |
| "<s_unitprice>": 57559, | |
| "<s_vatyn>": 57575, | |
| "<s_void_menu>": 57571, | |
| "<sep/>": 57522 | |
| } | |