Spaces:
Runtime error
Runtime error
import torch | |
from PIL import Image | |
from transformers import VisionEncoderDecoderModel, VisionEncoderDecoderConfig # , DonutProcessor | |
def demo_process(input_img): | |
global pretrained_model, task_prompt, task_name | |
# input_img = Image.fromarray(input_img) | |
output = pretrained_model.inference(image=input_img, prompt=task_prompt)["predictions"][0] | |
return output | |
task_prompt = f"<s>" | |
st.text('This model is trained with receipt images -> SROIE dataset.') |