Instructions to use rhlprj/donut-invoice-final with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use rhlprj/donut-invoice-final with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="rhlprj/donut-invoice-final")# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("rhlprj/donut-invoice-final") model = AutoModelForMultimodalLM.from_pretrained("rhlprj/donut-invoice-final") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use rhlprj/donut-invoice-final with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "rhlprj/donut-invoice-final" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "rhlprj/donut-invoice-final", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/rhlprj/donut-invoice-final
- SGLang
How to use rhlprj/donut-invoice-final 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 "rhlprj/donut-invoice-final" \ --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": "rhlprj/donut-invoice-final", "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 "rhlprj/donut-invoice-final" \ --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": "rhlprj/donut-invoice-final", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use rhlprj/donut-invoice-final with Docker Model Runner:
docker model run hf.co/rhlprj/donut-invoice-final
| { | |
| "add_prefix_space": true, | |
| "backend": "tokenizers", | |
| "bos_token": "<s>", | |
| "cls_token": "<s>", | |
| "eos_token": "</s>", | |
| "extra_special_tokens": [ | |
| "<s_invoice>", | |
| "<s_account_number>", | |
| "</s_account_number>", | |
| "<s_admission_date>", | |
| "</s_admission_date>", | |
| "<s_admission_number>", | |
| "</s_admission_number>", | |
| "<s_amount>", | |
| "</s_amount>", | |
| "<s_approved_amount>", | |
| "</s_approved_amount>", | |
| "<s_attending_doctor>", | |
| "</s_attending_doctor>", | |
| "<s_bank_name>", | |
| "</s_bank_name>", | |
| "<s_bill_date>", | |
| "</s_bill_date>", | |
| "<s_bill_number>", | |
| "</s_bill_number>", | |
| "<s_billed>", | |
| "</s_billed>", | |
| "<s_cargo_description>", | |
| "</s_cargo_description>", | |
| "<s_carrier_name>", | |
| "</s_carrier_name>", | |
| "<s_cash_paid>", | |
| "</s_cash_paid>", | |
| "<s_change>", | |
| "</s_change>", | |
| "<s_charges>", | |
| "</s_charges>", | |
| "<s_claim_date>", | |
| "</s_claim_date>", | |
| "<s_claim_number>", | |
| "</s_claim_number>", | |
| "<s_claim_status>", | |
| "</s_claim_status>", | |
| "<s_claim_type>", | |
| "</s_claim_type>", | |
| "<s_co_pay>", | |
| "</s_co_pay>", | |
| "<s_consignee_address>", | |
| "</s_consignee_address>", | |
| "<s_consignee_name>", | |
| "</s_consignee_name>", | |
| "<s_container_number>", | |
| "</s_container_number>", | |
| "<s_customer_address>", | |
| "</s_customer_address>", | |
| "<s_customer_gstin>", | |
| "</s_customer_gstin>", | |
| "<s_customer_name>", | |
| "</s_customer_name>", | |
| "<s_deductible>", | |
| "</s_deductible>", | |
| "<s_department>", | |
| "</s_department>", | |
| "<s_description>", | |
| "</s_description>", | |
| "<s_destination_port>", | |
| "</s_destination_port>", | |
| "<s_diagnosis>", | |
| "</s_diagnosis>", | |
| "<s_discharge_date>", | |
| "</s_discharge_date>", | |
| "<s_discount>", | |
| "</s_discount>", | |
| "<s_due_date>", | |
| "</s_due_date>", | |
| "<s_eligible_amount>", | |
| "</s_eligible_amount>", | |
| "<s_eob_number>", | |
| "</s_eob_number>", | |
| "<s_freight_type>", | |
| "</s_freight_type>", | |
| "<s_gross_weight>", | |
| "</s_gross_weight>", | |
| "<s_gst>", | |
| "</s_gst>", | |
| "<s_hospital_name>", | |
| "</s_hospital_name>", | |
| "<s_hs_code>", | |
| "</s_hs_code>", | |
| "<s_ifsc_code>", | |
| "</s_ifsc_code>", | |
| "<s_incoterms>", | |
| "</s_incoterms>", | |
| "<s_insurance_covered>", | |
| "</s_insurance_covered>", | |
| "<s_insurance_pays>", | |
| "</s_insurance_pays>", | |
| "<s_insurer_name>", | |
| "</s_insurer_name>", | |
| "<s_invoice_date>", | |
| "</s_invoice_date>", | |
| "<s_invoice_number>", | |
| "</s_invoice_number>", | |
| "<s_items>", | |
| "</s_items>", | |
| "<s_line_items>", | |
| "</s_line_items>", | |
| "<s_not_covered>", | |
| "</s_not_covered>", | |
| "<s_notify_party>", | |
| "</s_notify_party>", | |
| "<s_num_packages>", | |
| "</s_num_packages>", | |
| "<s_origin_port>", | |
| "</s_origin_port>", | |
| "<s_patient_address>", | |
| "</s_patient_address>", | |
| "<s_patient_age>", | |
| "</s_patient_age>", | |
| "<s_patient_blood_group>", | |
| "</s_patient_blood_group>", | |
| "<s_patient_gender>", | |
| "</s_patient_gender>", | |
| "<s_patient_liability>", | |
| "</s_patient_liability>", | |
| "<s_patient_name>", | |
| "</s_patient_name>", | |
| "<s_patient_type>", | |
| "</s_patient_type>", | |
| "<s_payment_mode>", | |
| "</s_payment_mode>", | |
| "<s_payment_terms>", | |
| "</s_payment_terms>", | |
| "<s_po_number>", | |
| "</s_po_number>", | |
| "<s_policy_holder>", | |
| "</s_policy_holder>", | |
| "<s_policy_number>", | |
| "</s_policy_number>", | |
| "<s_procedures>", | |
| "</s_procedures>", | |
| "<s_process_date>", | |
| "</s_process_date>", | |
| "<s_quantity>", | |
| "</s_quantity>", | |
| "<s_shipper_address>", | |
| "</s_shipper_address>", | |
| "<s_shipper_name>", | |
| "</s_shipper_name>", | |
| "<s_subtotal>", | |
| "</s_subtotal>", | |
| "<s_tax>", | |
| "</s_tax>", | |
| "<s_total>", | |
| "</s_total>", | |
| "<s_total_billed>", | |
| "</s_total_billed>", | |
| "<s_total_due>", | |
| "</s_total_due>", | |
| "<s_uhid>", | |
| "</s_uhid>", | |
| "<s_vendor_address>", | |
| "</s_vendor_address>", | |
| "<s_vendor_email>", | |
| "</s_vendor_email>", | |
| "<s_vendor_gstin>", | |
| "</s_vendor_gstin>", | |
| "<s_vendor_name>", | |
| "</s_vendor_name>", | |
| "<s_vendor_phone>", | |
| "</s_vendor_phone>", | |
| "<s_volume>", | |
| "</s_volume>", | |
| "<s_waybill_number>", | |
| "</s_waybill_number>", | |
| "<s_item>", | |
| "</s_item>" | |
| ], | |
| "from_slow": true, | |
| "is_local": true, | |
| "local_files_only": false, | |
| "mask_token": "<mask>", | |
| "model_max_length": 1000000000000000019884624838656, | |
| "pad_token": "<pad>", | |
| "processor_class": "DonutProcessor", | |
| "sep_token": "</s>", | |
| "sp_model_kwargs": {}, | |
| "tokenizer_class": "XLMRobertaTokenizer", | |
| "unk_token": "<unk>" | |
| } | |