byt5_correct / app.py
hantech's picture
Create app.py
8231943
raw
history blame
366 Bytes
import gradio as gr
from simplet5 import SimpleT5
model = SimpleT5()
# let's load the trained model for inferencing:
model.load_model("byt5","hantech/byt5_correct2", use_gpu=False)
def predict(img, text):
result = model.predict(text)
return result[0]
gr.Interface(predict, [gr.Image(type="filepath"), gr.Textbox(label="Question")], gr.Textbox()).launch()