Skip to content

Instantly share code, notes, and snippets.

Verifying myself: My Bitcoin username is +fuzzie. https://onename.io/fuzzie
@fuzzie360
fuzzie360 / donut.py
Last active February 26, 2024 01:19
Document QA sample python programs
from transformers import pipeline
from PIL import Image
pipe = pipeline("document-question-answering", model="naver-clova-ix/donut-base-finetuned-docvqa")
question = "For what period is this payslip for?"
image = Image.open("./input.jpg")
output = pipe(image=image, question=question)