File size: 619 Bytes
8cc757b
32a276c
8cc757b
03c65d9
8cc757b
7310c03
03c65d9
32a276c
03c65d9
 
78f41eb
c7fb698
 
03c65d9
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import gradio as gr
from transformers import pipeline

qa_model = pipeline("question-answering",'a-ware/bart-squadv2')

def fetch_answer(question, context ):
    return qa_model(question = question, context = context)['answer']

demo = gr.Interface(
    fn=fetch_answer,
    #take input as real time audio and use OPENAPI whisper for S2T
    inputs=[gr.Textbox(lines=2, placeholder="What is age of patient...",examples=['questiontest1','questiontest2']),
            gr.Textbox(lines=2, placeholder="The patient is a 71 year old male...", examples=['contexttest1','contexttest2'])],
    outputs="text",
)
demo.launch()