Instructions to use cbwheadon/donut-custom-extractor with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cbwheadon/donut-custom-extractor with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="cbwheadon/donut-custom-extractor")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("cbwheadon/donut-custom-extractor") model = AutoModelForMultimodalLM.from_pretrained("cbwheadon/donut-custom-extractor", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use cbwheadon/donut-custom-extractor with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cbwheadon/donut-custom-extractor" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cbwheadon/donut-custom-extractor", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/cbwheadon/donut-custom-extractor
- SGLang
How to use cbwheadon/donut-custom-extractor 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 "cbwheadon/donut-custom-extractor" \ --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": "cbwheadon/donut-custom-extractor", "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 "cbwheadon/donut-custom-extractor" \ --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": "cbwheadon/donut-custom-extractor", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use cbwheadon/donut-custom-extractor with Docker Model Runner:
docker model run hf.co/cbwheadon/donut-custom-extractor
Download tokenizer_config.json from cbwheadon/donut-custom-extractor: direct link, hf CLI and curl.
- Browser
- Download file 3.41 kB
-
https://huggingface.co/cbwheadon/donut-custom-extractor/resolve/main/tokenizer_config.json
- Command line
-
hf download hf://cbwheadon/donut-custom-extractor/tokenizer_config.json
-
curl -L -o tokenizer_config.json https://huggingface.co/cbwheadon/donut-custom-extractor/resolve/main/tokenizer_config.json
3.41 kB
| { | |
| "added_tokens_decoder": { | |
| "0": { | |
| "content": "<s>", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "1": { | |
| "content": "<pad>", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "2": { | |
| "content": "</s>", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "3": { | |
| "content": "<unk>", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "57521": { | |
| "content": "<mask>", | |
| "lstrip": true, | |
| "normalized": true, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "57522": { | |
| "content": "<sep/>", | |
| "lstrip": false, | |
| "normalized": true, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": false | |
| }, | |
| "57523": { | |
| "content": "</s_answer>", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "57524": { | |
| "content": "</s_question>", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "57525": { | |
| "content": "<no/>", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "57526": { | |
| "content": "<s_answer>", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "57527": { | |
| "content": "<s_docvqa>", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "57528": { | |
| "content": "<s_iitcdip>", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "57529": { | |
| "content": "<s_question>", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "57530": { | |
| "content": "<s_synthdog>", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "57531": { | |
| "content": "<yes/>", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| } | |
| }, | |
| "additional_special_tokens": [ | |
| "</s_answer>", | |
| "</s_question>", | |
| "<no/>", | |
| "<s_answer>", | |
| "<s_docvqa>", | |
| "<s_iitcdip>", | |
| "<s_question>", | |
| "<s_synthdog>", | |
| "<yes/>" | |
| ], | |
| "bos_token": "<s>", | |
| "clean_up_tokenization_spaces": false, | |
| "cls_token": "<s>", | |
| "eos_token": "</s>", | |
| "extra_special_tokens": {}, | |
| "mask_token": "<mask>", | |
| "max_length": 256, | |
| "model_max_length": 1000000000000000019884624838656, | |
| "pad_to_multiple_of": null, | |
| "pad_token": "<pad>", | |
| "pad_token_type_id": 0, | |
| "padding_side": "right", | |
| "processor_class": "DonutProcessor", | |
| "sep_token": "</s>", | |
| "sp_model_kwargs": {}, | |
| "stride": 0, | |
| "tokenizer_class": "XLMRobertaTokenizer", | |
| "truncation_side": "right", | |
| "truncation_strategy": "longest_first", | |
| "unk_token": "<unk>" | |
| } | |