Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -50,24 +50,25 @@ if __name__ == "__main__":
|
|
| 50 |
|
| 51 |
# submit = st.button("Search")
|
| 52 |
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
|
|
|
| 73 |
|
|
|
|
| 50 |
|
| 51 |
# submit = st.button("Search")
|
| 52 |
|
| 53 |
+
with st.spinner("Searching..."):
|
| 54 |
+
if st.button("Search"):
|
| 55 |
+
# Pull index data from Chroma
|
| 56 |
+
relavant_docs = pull_from_chroma(prompt)
|
| 57 |
+
st.toast("Chroma index retrieval done...")
|
| 58 |
+
# st.write(relavant_docs)
|
| 59 |
+
if prompt and relavant_docs:
|
| 60 |
+
if not load_button:
|
| 61 |
+
if st.session_state['HuggingFace_API_Key'] != "":
|
| 62 |
+
# Displaying search results
|
| 63 |
+
st.success("Please find the search results :")
|
| 64 |
+
for index in range(min(document_count, len(relavant_docs))):
|
| 65 |
+
document = relavant_docs[index]
|
| 66 |
+
st.write("👉**Result : " + str(index + 1) + "**")
|
| 67 |
+
st.write("**Info**: " + get_summary(relavant_docs[index]))
|
| 68 |
+
# st.write("**Info**: " + document.page_content)
|
| 69 |
+
st.write("**Link**: " + document.metadata['source'])
|
| 70 |
+
st.markdown("-----------------------------------------------------------------------")
|
| 71 |
+
|
| 72 |
+
else:
|
| 73 |
+
st.sidebar.error("Ooopssss!!! Please provide API key.....")
|
| 74 |
|