Instructions to use Falconsai/florence-2-invoice with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Falconsai/florence-2-invoice with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Falconsai/florence-2-invoice", trust_remote_code=True)# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("Falconsai/florence-2-invoice", trust_remote_code=True) model = AutoModelForImageTextToText.from_pretrained("Falconsai/florence-2-invoice", trust_remote_code=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Falconsai/florence-2-invoice with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Falconsai/florence-2-invoice" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Falconsai/florence-2-invoice", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Falconsai/florence-2-invoice
- SGLang
How to use Falconsai/florence-2-invoice 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 "Falconsai/florence-2-invoice" \ --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": "Falconsai/florence-2-invoice", "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 "Falconsai/florence-2-invoice" \ --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": "Falconsai/florence-2-invoice", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Falconsai/florence-2-invoice with Docker Model Runner:
docker model run hf.co/Falconsai/florence-2-invoice
Update README.md
Browse files
README.md
CHANGED
|
@@ -16,24 +16,12 @@ tags: []
|
|
| 16 |
|
| 17 |
`Falconsai/florence-2-invoice` is a fine-tuned version of the `microsoft/Florence-2-base-ft` model. This model has been specifically trained to identify and extract key fields from invoice images. The fine-tuning process utilized a curated dataset of invoices annotated to recognize the following fields:
|
| 18 |
|
| 19 |
-
- Billing address
|
| 20 |
-
-
|
| 21 |
-
-
|
| 22 |
-
-
|
| 23 |
-
-
|
| 24 |
-
|
| 25 |
-
- Invoice number
|
| 26 |
-
- Name client
|
| 27 |
-
- Products
|
| 28 |
-
- Remise
|
| 29 |
-
- Shipping address
|
| 30 |
-
- Subtotal
|
| 31 |
-
- Tax
|
| 32 |
-
- Tax percentage
|
| 33 |
-
- Tel client
|
| 34 |
-
- Total
|
| 35 |
-
|
| 36 |
-
## Model Details
|
| 37 |
|
| 38 |
### Base Model
|
| 39 |
The base model used for fine-tuning is `microsoft/Florence-2-base-ft`, a state-of-the-art vision model developed by Microsoft.
|
|
|
|
| 16 |
|
| 17 |
`Falconsai/florence-2-invoice` is a fine-tuned version of the `microsoft/Florence-2-base-ft` model. This model has been specifically trained to identify and extract key fields from invoice images. The fine-tuning process utilized a curated dataset of invoices annotated to recognize the following fields:
|
| 18 |
|
| 19 |
+
- Billing address, - Discount percentage, - Due date
|
| 20 |
+
- Email client, - Header, - Invoice date
|
| 21 |
+
- Invoice number, - Name client, - Products
|
| 22 |
+
- Remise, - Shipping address, - Subtotal
|
| 23 |
+
- Tax, - Tax percentage, - Tel client, - Total
|
| 24 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
### Base Model
|
| 27 |
The base model used for fine-tuning is `microsoft/Florence-2-base-ft`, a state-of-the-art vision model developed by Microsoft.
|