File size: 385 Bytes
0483ead
50f79a7
0483ead
 
50f79a7
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="zpm/Llama-3.1-PersianQA")

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

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

iface.launch()