basque-qa / app.py
MarcBrun's picture
Update app.py
772bcf5
raw
history blame
538 Bytes
import gradio as gr
from transformers import pipeline
import torch
qa = pipeline("question-answering", model="MarcBrun/ixambert-finetuned-squad")
def answer_question(question, answer_text):
answer = qa(question=question, context=answer_text)
return answer["answer"]
iface = gr.Interface(fn=answer_question, inputs=[gr.inputs.Textbox(lines=1, placeholder="Question Here...", label="Question"),gr.inputs.Textbox(lines=5, placeholder="Context Here...", label="Context")], outputs=gr.outputs.Textbox(label="Answer"))
iface.launch()