question_answer / app.py
aditi2222's picture
Update app.py
82f9889
raw
history blame contribute delete
No virus
457 Bytes
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)