Instructions to use to-be/donut-base-finetuned-invoices with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use to-be/donut-base-finetuned-invoices with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "image-to-text" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # pip install "transformers<5.0.0" from transformers import pipeline pipe = pipeline("image-to-text", model="to-be/donut-base-finetuned-invoices")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("to-be/donut-base-finetuned-invoices") model = AutoModelForMultimodalLM.from_pretrained("to-be/donut-base-finetuned-invoices", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Changing the text generation method.
#4
by Prabhav55221 - opened
Hi Team,
I have been using this implementation of DONUT for a use case regarding invoices. First of all, thank you for this codebase - It is really helpful.
However, I was wondering if there a provision to change the text generator model being used by this pipeline. Is there a particular reason that options like GPT2 were not used to generate the text from image?
Hi,
This was merely a finetune. I think your question is better directed to the authors of the original Donut paper.
to-be changed discussion status to closed