ace-turing / app.py
Framos888's picture
Upload app.py
a36358f verified
raw
history blame contribute delete
410 Bytes
import gradio as gr
from transformers import pipeline
qa = pipeline("question-answering", model="distilbert-base-uncased-distilled-squad")
def responder(contexto, pregunta):
respuesta = qa(question=pregunta, context=contexto)
return respuesta["answer"]
app = gr.Interface(
fn=responder,
inputs=[gr.Textbox(label="Contexto"), gr.Textbox(label="Pregunta")],
outputs="text"
)
app.launch()