Update src/streamlit_app.py
Browse files- src/streamlit_app.py +3 -3
src/streamlit_app.py
CHANGED
|
@@ -175,14 +175,14 @@ if doc_choice == "-- Select --":
|
|
| 175 |
else:
|
| 176 |
if doc_choice == "Sample PDF":
|
| 177 |
temp_path = os.path.join(os.path.dirname(__file__), "sample.pdf")
|
| 178 |
-
st.success("π Sample
|
| 179 |
else:
|
| 180 |
uploaded_file = st.file_uploader("", type="pdf", label_visibility="collapsed")
|
| 181 |
if uploaded_file:
|
| 182 |
temp_path = os.path.join("/tmp", uploaded_file.name)
|
| 183 |
with open(temp_path, "wb") as f:
|
| 184 |
f.write(uploaded_file.getbuffer())
|
| 185 |
-
st.success(
|
| 186 |
else:
|
| 187 |
temp_path = None
|
| 188 |
|
|
@@ -193,7 +193,6 @@ else:
|
|
| 193 |
with st.spinner("βοΈ Building search index..."):
|
| 194 |
embeddings = cache_embeddings(os.path.basename(temp_path), chunks, embed_chunks)
|
| 195 |
index = build_faiss_index(embeddings)
|
| 196 |
-
st.success("β
Document ready β you can now ask your question below.")
|
| 197 |
|
| 198 |
doc_name = os.path.basename(temp_path)
|
| 199 |
if st.session_state["last_doc"] != doc_name:
|
|
@@ -203,6 +202,7 @@ else:
|
|
| 203 |
else:
|
| 204 |
query_suggestions = st.session_state["query_suggestions_fixed"]
|
| 205 |
|
|
|
|
| 206 |
# ----------------------------------------------------------
|
| 207 |
# π¬ ASK SECTION
|
| 208 |
# ----------------------------------------------------------
|
|
|
|
| 175 |
else:
|
| 176 |
if doc_choice == "Sample PDF":
|
| 177 |
temp_path = os.path.join(os.path.dirname(__file__), "sample.pdf")
|
| 178 |
+
st.success("π Sample document loaded successfully β you can start asking your questions below.")
|
| 179 |
else:
|
| 180 |
uploaded_file = st.file_uploader("", type="pdf", label_visibility="collapsed")
|
| 181 |
if uploaded_file:
|
| 182 |
temp_path = os.path.join("/tmp", uploaded_file.name)
|
| 183 |
with open(temp_path, "wb") as f:
|
| 184 |
f.write(uploaded_file.getbuffer())
|
| 185 |
+
st.success("β
Document processed successfully β you can start asking your questions below.")
|
| 186 |
else:
|
| 187 |
temp_path = None
|
| 188 |
|
|
|
|
| 193 |
with st.spinner("βοΈ Building search index..."):
|
| 194 |
embeddings = cache_embeddings(os.path.basename(temp_path), chunks, embed_chunks)
|
| 195 |
index = build_faiss_index(embeddings)
|
|
|
|
| 196 |
|
| 197 |
doc_name = os.path.basename(temp_path)
|
| 198 |
if st.session_state["last_doc"] != doc_name:
|
|
|
|
| 202 |
else:
|
| 203 |
query_suggestions = st.session_state["query_suggestions_fixed"]
|
| 204 |
|
| 205 |
+
|
| 206 |
# ----------------------------------------------------------
|
| 207 |
# π¬ ASK SECTION
|
| 208 |
# ----------------------------------------------------------
|