File size: 398 Bytes
0483ead
50f79a7
0483ead
 
b0a32d3
0483ead
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import gradio as gr
# Use a pipeline as a high-level helper
from transformers import pipeline

pipe = pipeline("document-question-answering", model="Or4cl3-1/multimodal-fusion-optimized")

def launch(input):
    out = pipe(input)
    return out[0]['generated_text']

iface = gr.Interface(launch,
                     inputs=gr.Image(type='pil'),
                     outputs="text")

iface.launch()