Spaces:
Runtime error
Runtime error
orderlymirror
commited on
Commit
•
ca2f8d5
1
Parent(s):
24c237f
Update app.py
Browse files
app.py
CHANGED
@@ -38,13 +38,16 @@ from langchain.llms import OpenAI
|
|
38 |
|
39 |
chain = load_qa_chain(OpenAI(), chain_type="stuff")
|
40 |
|
41 |
-
query
|
42 |
-
docs = docsearch.similarity_search(query)
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
|
|
|
|
|
|
50 |
iface.launch()
|
|
|
38 |
|
39 |
chain = load_qa_chain(OpenAI(), chain_type="stuff")
|
40 |
|
41 |
+
def interactive_search(query):
|
42 |
+
docs = docsearch.similarity_search(query)
|
43 |
+
|
44 |
+
result = chain.run(input_documents=docs, question=query)
|
45 |
+
|
46 |
+
return result
|
47 |
+
|
48 |
+
iface = gr.Interface(interactive_search,
|
49 |
+
inputs="text",
|
50 |
+
outputs="text",
|
51 |
+
title="Interactive Search",
|
52 |
+
description="Enter a query.")
|
53 |
iface.launch()
|