Jonglee commited on
Commit
3348ed6
·
1 Parent(s): 5225959

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -0
app.py CHANGED
@@ -42,3 +42,17 @@ doc_retriever = vectordb.as_retriever()
42
  from langchain.chains import RetrievalQA
43
  EN_17272_qa = RetrievalQA.from_chain_type(llm, chain_type="stuff", retriever=doc_retriever)
44
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  from langchain.chains import RetrievalQA
43
  EN_17272_qa = RetrievalQA.from_chain_type(llm, chain_type="stuff", retriever=doc_retriever)
44
 
45
+ def make_answer(query):
46
+ return EN_17272_qa.run(query)
47
+
48
+ if __name__ == "__main__":
49
+ # make a gradio intgerface
50
+ import gradio as gr
51
+
52
+ gr.Interface(
53
+ make_answer,
54
+ [gr.inputs.Textbox(lines=2, label="Input a question")],
55
+ gr.outputs.Textbox(labels="Answer"),
56
+ title="EN-17272 & Efficacy Reports",
57
+ descriptions: "EN-17272 & Efficacy reports is a generative model that gives answers based on the documents",
58
+ ).launch()