File size: 457 Bytes
68b074f
 
 
 
 
 
 
82f9889
68b074f
 
 
 
 
 
5a41317
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import os
import pandas as pd
from ast import literal_eval
import joblib

import gradio as gr

cdqa_pipeline=joblib.load('aditi2222/question_answer/bert_qa_custom.joblib') #fitted pipleine

def generate_answers(query):
    prediction = cdqa_pipeline.predict(query, 3) #provides top three responses
    return prediction

iface = gr.Interface(fn=generate_answers, inputs=[gr.inputs.Textbox(lines=30)],outputs=["query"])
iface.launch(inline=False, share=True)