File size: 689 Bytes
f162045 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
import gradio as gr
from transformers import pipeline
question_answerer = pipeline("question-answering", model="shashankheg/my_qa_model")
def QA(Question,Context):
result=question_answerer(question=Question, context=Context)
for answer in result:
return result['answer']
interface = gr.Interface(fn =QA,
inputs = ['text','text'],
outputs=['text'],
title= 'Qustion Answering using Distilbert',
theme = gr.themes.Citrus(),
css = """"
body {background-color: #FFCCCB}"""
)
interface.launch() |