Run this model with HF Jobs
Run KevinHgF/donutv2 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/KevinHgF/donutv2. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/KevinHgF/donutv2 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/KevinHgF/donutv2. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/KevinHgF/donutv2. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use KevinHgF/donutv2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use KevinHgF/donutv2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="KevinHgF/donutv2")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("KevinHgF/donutv2") model = AutoModelForMultimodalLM.from_pretrained("KevinHgF/donutv2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use KevinHgF/donutv2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "KevinHgF/donutv2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "KevinHgF/donutv2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/KevinHgF/donutv2
- SGLang
How to use KevinHgF/donutv2 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 "KevinHgF/donutv2" \ --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": "KevinHgF/donutv2", "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 "KevinHgF/donutv2" \ --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": "KevinHgF/donutv2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use KevinHgF/donutv2 with Docker Model Runner:
docker model run hf.co/KevinHgF/donutv2
Download added_tokens.json from KevinHgF/donutv2: direct link, hf CLI and curl.
- Browser
- Download file 1.19 kB
-
https://huggingface.co/KevinHgF/donutv2/resolve/main/added_tokens.json
- Command line
-
hf download hf://KevinHgF/donutv2/added_tokens.json
-
curl -L -o added_tokens.json https://huggingface.co/KevinHgF/donutv2/resolve/main/added_tokens.json
1.19 kB
| { | |
| "</s_None>": 57564, | |
| "</s_client>": 57534, | |
| "</s_client_tax_id>": 57538, | |
| "</s_header>": 57526, | |
| "</s_iban>": 57540, | |
| "</s_invoice_date>": 57530, | |
| "</s_invoice_no>": 57528, | |
| "</s_item_desc>": 57544, | |
| "</s_item_gross_worth>": 57554, | |
| "</s_item_net_price>": 57548, | |
| "</s_item_net_worth>": 57550, | |
| "</s_item_qty>": 57546, | |
| "</s_item_vat>": 57552, | |
| "</s_items>": 57542, | |
| "</s_seller>": 57532, | |
| "</s_seller_tax_id>": 57536, | |
| "</s_summary>": 57556, | |
| "</s_total_gross_worth>": 57562, | |
| "</s_total_net_worth>": 57558, | |
| "</s_total_vat>": 57560, | |
| "<s_None>": 57563, | |
| "<s_client>": 57533, | |
| "<s_client_tax_id>": 57537, | |
| "<s_cord-v2>": 57565, | |
| "<s_header>": 57525, | |
| "<s_iban>": 57539, | |
| "<s_iitcdip>": 57523, | |
| "<s_invoice_date>": 57529, | |
| "<s_invoice_no>": 57527, | |
| "<s_item_desc>": 57543, | |
| "<s_item_gross_worth>": 57553, | |
| "<s_item_net_price>": 57547, | |
| "<s_item_net_worth>": 57549, | |
| "<s_item_qty>": 57545, | |
| "<s_item_vat>": 57551, | |
| "<s_items>": 57541, | |
| "<s_seller>": 57531, | |
| "<s_seller_tax_id>": 57535, | |
| "<s_summary>": 57555, | |
| "<s_synthdog>": 57524, | |
| "<s_total_gross_worth>": 57561, | |
| "<s_total_net_worth>": 57557, | |
| "<s_total_vat>": 57559, | |
| "<sep/>": 57522 | |
| } | |