cool-api / app.py
preston-cell's picture
Update app.py
50f79a7 verified
raw
history blame
385 Bytes
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()