Image-Text-to-Text
Transformers
TensorBoard
Safetensors
pix2struct
Generated from Trainer
invoice-processing
information-extraction
czech-language
document-ai
multimodal-model
generative-model
synthetic-data
layout-augmentation
Instructions to use TomasFAV/Pix2StructCzechInvoiceV01 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TomasFAV/Pix2StructCzechInvoiceV01 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="TomasFAV/Pix2StructCzechInvoiceV01")# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("TomasFAV/Pix2StructCzechInvoiceV01") model = AutoModelForImageTextToText.from_pretrained("TomasFAV/Pix2StructCzechInvoiceV01") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use TomasFAV/Pix2StructCzechInvoiceV01 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "TomasFAV/Pix2StructCzechInvoiceV01" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TomasFAV/Pix2StructCzechInvoiceV01", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/TomasFAV/Pix2StructCzechInvoiceV01
- SGLang
How to use TomasFAV/Pix2StructCzechInvoiceV01 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 "TomasFAV/Pix2StructCzechInvoiceV01" \ --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": "TomasFAV/Pix2StructCzechInvoiceV01", "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 "TomasFAV/Pix2StructCzechInvoiceV01" \ --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": "TomasFAV/Pix2StructCzechInvoiceV01", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use TomasFAV/Pix2StructCzechInvoiceV01 with Docker Model Runner:
docker model run hf.co/TomasFAV/Pix2StructCzechInvoiceV01
Upload processor
Browse files- processor_config.json +19 -0
- tokenizer.json +0 -0
- tokenizer_config.json +45 -0
processor_config.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"image_processor": {
|
| 3 |
+
"data_format": "channels_first",
|
| 4 |
+
"do_convert_rgb": true,
|
| 5 |
+
"do_normalize": true,
|
| 6 |
+
"image_processor_type": "Pix2StructImageProcessorFast",
|
| 7 |
+
"is_vqa": true,
|
| 8 |
+
"max_patches": 2048,
|
| 9 |
+
"patch_size": {
|
| 10 |
+
"height": 16,
|
| 11 |
+
"width": 16
|
| 12 |
+
},
|
| 13 |
+
"size": {
|
| 14 |
+
"height": 2338,
|
| 15 |
+
"width": 1654
|
| 16 |
+
}
|
| 17 |
+
},
|
| 18 |
+
"processor_class": "Pix2StructProcessor"
|
| 19 |
+
}
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"backend": "tokenizers",
|
| 3 |
+
"eos_token": "</s>",
|
| 4 |
+
"extra_ids": 100,
|
| 5 |
+
"extra_special_tokens": [
|
| 6 |
+
"</s_due_date>",
|
| 7 |
+
"</s_issue_date>",
|
| 8 |
+
"<s_invoice_number>",
|
| 9 |
+
"</s_invoice_number>",
|
| 10 |
+
"</s_cust_tax_id>",
|
| 11 |
+
"<s_taxable_supply_date>",
|
| 12 |
+
"<s_supp_tax_id>",
|
| 13 |
+
"<s_bank_account_number>",
|
| 14 |
+
"</s_total>",
|
| 15 |
+
"<s_iban>",
|
| 16 |
+
"</s_supp_tax_id>",
|
| 17 |
+
"<s_const_symbol>",
|
| 18 |
+
"</s_payment_type>",
|
| 19 |
+
"</s_variable_symbol>",
|
| 20 |
+
"<s_payment_type>",
|
| 21 |
+
"<s_variable_symbol>",
|
| 22 |
+
"</s_iban>",
|
| 23 |
+
"<s_total>",
|
| 24 |
+
"</s_const_symbol>",
|
| 25 |
+
"</s_taxable_supply_date>",
|
| 26 |
+
"<s_cust_register_id>",
|
| 27 |
+
"</s_cust_register_id>",
|
| 28 |
+
"<s_issue_date>",
|
| 29 |
+
"</s_bank_account_number>",
|
| 30 |
+
"<s_cust_tax_id>",
|
| 31 |
+
"</s_bic>",
|
| 32 |
+
"</s_supp_register_id>",
|
| 33 |
+
"<s_supp_register_id>",
|
| 34 |
+
"<s_due_date>",
|
| 35 |
+
"<s_bic>"
|
| 36 |
+
],
|
| 37 |
+
"is_local": false,
|
| 38 |
+
"is_vqa": true,
|
| 39 |
+
"model_max_length": 1000000000000000019884624838656,
|
| 40 |
+
"pad_token": "<pad>",
|
| 41 |
+
"processor_class": "Pix2StructProcessor",
|
| 42 |
+
"sp_model_kwargs": {},
|
| 43 |
+
"tokenizer_class": "T5Tokenizer",
|
| 44 |
+
"unk_token": "<unk>"
|
| 45 |
+
}
|