Spaces:
Runtime error
Runtime error
Commit ·
5853234
1
Parent(s): f26c6ec
second
Browse files
app.py
CHANGED
|
@@ -84,19 +84,19 @@ def main():
|
|
| 84 |
query = st.text_input("Query: ", "", key="input")
|
| 85 |
result_display = st.empty()
|
| 86 |
|
| 87 |
-
|
| 88 |
-
|
| 89 |
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
|
| 94 |
-
|
| 95 |
-
|
| 96 |
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
|
| 101 |
elif (not api_key):
|
| 102 |
st.info("Please add configuration details in left panel")
|
|
|
|
| 84 |
query = st.text_input("Query: ", "", key="input")
|
| 85 |
result_display = st.empty()
|
| 86 |
|
| 87 |
+
if query is not None:
|
| 88 |
+
persist_directory = file_path[:-4]
|
| 89 |
|
| 90 |
+
# Now we can load the persisted database from disk, and use it as normal.
|
| 91 |
+
vectordb = Chroma(persist_directory=persist_directory,
|
| 92 |
+
embedding_function=embeddings)
|
| 93 |
|
| 94 |
+
# create a retriever
|
| 95 |
+
retriever = vectordb.as_retriever(search_kwargs={"k": 3})
|
| 96 |
|
| 97 |
+
result = retrieve(query,llm,retriever)
|
| 98 |
+
# Text area for editing the generated response
|
| 99 |
+
result_display.text_area("Result:", value=result, height=500)
|
| 100 |
|
| 101 |
elif (not api_key):
|
| 102 |
st.info("Please add configuration details in left panel")
|