Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
|
35 |
|
36 |
-
with gr.Blocks() as demo:
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
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 |
|