kweyamba commited on
Commit
04c03db
1 Parent(s): 6e1559c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -14
app.py CHANGED
@@ -23,25 +23,26 @@ qdrant = Qdrant.from_documents(
23
  docs, embeddings, host=host, prefer_grpc=True, api_key=api_key
24
  )
25
 
 
26
 
27
 
28
- def question_answering(question):
29
- chain = load_qa_chain(OpenAI(temperature=0), chain_type="stuff")
30
- query = question
31
- docs = qdrant.similarity_search(query)
32
- answer = chain.run(input_documents=docs, question=query)
33
- return answer
34
 
35
 
36
- with gr.Blocks() as demo:
37
- gr.Markdown("Start the typing below and then click **Run** to see the output.")
38
- with gr.Row():
39
- inp = gr.Textbox(placeholder="Ask question here?")
40
- out = gr.Textbox()
41
- btn = gr.Button("Run")
42
- btn.click(fn=question_answering, inputs=inp, outputs=out, api_name="search", queue=True)
43
 
44
- demo.launch()
45
 
46
 
47
 
 
23
  docs, embeddings, host=host, prefer_grpc=True, api_key=api_key
24
  )
25
 
26
+ print(docs[1])
27
 
28
 
29
+ # def question_answering(question):
30
+ # chain = load_qa_chain(OpenAI(temperature=0), chain_type="stuff")
31
+ # query = question
32
+ # docs = qdrant.similarity_search(query)
33
+ # answer = chain.run(input_documents=docs, question=query)
34
+ # return answer
35
 
36
 
37
+ # with gr.Blocks() as demo:
38
+ # gr.Markdown("Start the typing below and then click **Run** to see the output.")
39
+ # with gr.Row():
40
+ # inp = gr.Textbox(placeholder="Ask question here?")
41
+ # out = gr.Textbox()
42
+ # btn = gr.Button("Run")
43
+ # btn.click(fn=question_answering, inputs=inp, outputs=out, api_name="search", queue=True)
44
 
45
+ # demo.launch()
46
 
47
 
48