Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -171,14 +171,14 @@ def reset_results(*args):
|
|
171 |
|
172 |
# Title
|
173 |
st.write("# GPT3 and Langchain Demo")
|
174 |
-
st.markdown(
|
175 |
-
|
176 |
-
This demo takes its data from the documents uploaded to the Pinecone index through this app. \n
|
177 |
-
Ask any question from the uploaded documents and Pinecone will retrieve the context for answers and GPT3 will answer them using the retrieved context. \n
|
178 |
-
*Note: do not use keywords, but full-fledged questions.* The demo is not optimized to deal with keyword queries and might misunderstand you.
|
179 |
-
""",
|
180 |
-
|
181 |
-
)
|
182 |
|
183 |
# Sidebar
|
184 |
st.sidebar.header("Options")
|
@@ -197,7 +197,12 @@ for data_file in data_files:
|
|
197 |
ALL_FILES.append(file_path)
|
198 |
st.sidebar.write(str(data_file.name) + " ✅ ")
|
199 |
META_DATA.append({"filename": data_file.name})
|
|
|
|
|
|
|
200 |
|
|
|
|
|
201 |
|
202 |
if len(ALL_FILES) > 0:
|
203 |
# document_store.update_embeddings(retriever, update_existing_embeddings=False)
|
@@ -284,7 +289,7 @@ col1.markdown("<style>.stButton button {width:100%;}</style>", unsafe_allow_html
|
|
284 |
col2.markdown("<style>.stButton button {width:100%;}</style>", unsafe_allow_html=True)
|
285 |
|
286 |
# Run button
|
287 |
-
run_pressed = col1.button("
|
288 |
if run_pressed:
|
289 |
|
290 |
run_query = run_pressed or question != st.session_state.question
|
|
|
171 |
|
172 |
# Title
|
173 |
st.write("# GPT3 and Langchain Demo")
|
174 |
+
# st.markdown(
|
175 |
+
# """
|
176 |
+
# This demo takes its data from the documents uploaded to the Pinecone index through this app. \n
|
177 |
+
# Ask any question from the uploaded documents and Pinecone will retrieve the context for answers and GPT3 will answer them using the retrieved context. \n
|
178 |
+
# *Note: do not use keywords, but full-fledged questions.* The demo is not optimized to deal with keyword queries and might misunderstand you.
|
179 |
+
# """,
|
180 |
+
# unsafe_allow_html=True,
|
181 |
+
# )
|
182 |
|
183 |
# Sidebar
|
184 |
st.sidebar.header("Options")
|
|
|
197 |
ALL_FILES.append(file_path)
|
198 |
st.sidebar.write(str(data_file.name) + " ✅ ")
|
199 |
META_DATA.append({"filename": data_file.name})
|
200 |
+
# ALL_FILES = ["./wellous_products.txt"]
|
201 |
+
# "wellous_products.txt"
|
202 |
+
# META_DATA.append({"filename": data_file.name})
|
203 |
|
204 |
+
print(ALL_FILES)
|
205 |
+
print(META_DATA)
|
206 |
|
207 |
if len(ALL_FILES) > 0:
|
208 |
# document_store.update_embeddings(retriever, update_existing_embeddings=False)
|
|
|
289 |
col2.markdown("<style>.stButton button {width:100%;}</style>", unsafe_allow_html=True)
|
290 |
|
291 |
# Run button
|
292 |
+
run_pressed = col1.button("Send")
|
293 |
if run_pressed:
|
294 |
|
295 |
run_query = run_pressed or question != st.session_state.question
|