Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -306,7 +306,7 @@ def page1():
|
|
| 306 |
# Start timing
|
| 307 |
start_time = time.time()
|
| 308 |
|
| 309 |
-
with st.spinner('
|
| 310 |
chain = load_chatbot()
|
| 311 |
docs = VectorStore.similarity_search(query=query, k=5)
|
| 312 |
with get_openai_callback() as cb:
|
|
@@ -320,9 +320,10 @@ def page1():
|
|
| 320 |
|
| 321 |
# Calculate duration
|
| 322 |
duration = end_time - start_time
|
| 323 |
-
|
|
|
|
| 324 |
|
| 325 |
-
st.
|
| 326 |
|
| 327 |
# Combine chat histories from all pages
|
| 328 |
all_chat_histories = [
|
|
@@ -428,7 +429,7 @@ def page2():
|
|
| 428 |
# Start timing
|
| 429 |
start_time = time.time()
|
| 430 |
|
| 431 |
-
with st.spinner('
|
| 432 |
chain = load_chatbot()
|
| 433 |
docs = VectorStore.similarity_search(query=query, k=5)
|
| 434 |
with get_openai_callback() as cb:
|
|
@@ -442,9 +443,9 @@ def page2():
|
|
| 442 |
|
| 443 |
# Calculate duration
|
| 444 |
duration = end_time - start_time
|
| 445 |
-
st.text(f"Response time: {duration:.2f} seconds")
|
| 446 |
|
| 447 |
-
st.session_state['chat_history_page2'].append(("
|
|
|
|
| 448 |
|
| 449 |
|
| 450 |
# Combine chat histories from all pages
|
|
@@ -547,7 +548,7 @@ def page3():
|
|
| 547 |
# Start timing
|
| 548 |
start_time = time.time()
|
| 549 |
|
| 550 |
-
with st.spinner('
|
| 551 |
chain = load_chatbot()
|
| 552 |
docs = VectorStore.similarity_search(query=query, k=5)
|
| 553 |
with get_openai_callback() as cb:
|
|
@@ -561,9 +562,9 @@ def page3():
|
|
| 561 |
|
| 562 |
# Calculate duration
|
| 563 |
duration = end_time - start_time
|
| 564 |
-
st.text(f"Response time: {duration:.2f} seconds")
|
| 565 |
|
| 566 |
-
st.session_state['chat_history_page3'].append(("
|
|
|
|
| 567 |
|
| 568 |
# Combine chat histories from all pages
|
| 569 |
all_chat_histories = [
|
|
|
|
| 306 |
# Start timing
|
| 307 |
start_time = time.time()
|
| 308 |
|
| 309 |
+
with st.spinner('Eve is thinking...'):
|
| 310 |
chain = load_chatbot()
|
| 311 |
docs = VectorStore.similarity_search(query=query, k=5)
|
| 312 |
with get_openai_callback() as cb:
|
|
|
|
| 320 |
|
| 321 |
# Calculate duration
|
| 322 |
duration = end_time - start_time
|
| 323 |
+
|
| 324 |
+
st.session_state['chat_history_page1'].append(("Eve", response, "new"))
|
| 325 |
|
| 326 |
+
st.text(f"Response time: {duration:.2f} seconds")
|
| 327 |
|
| 328 |
# Combine chat histories from all pages
|
| 329 |
all_chat_histories = [
|
|
|
|
| 429 |
# Start timing
|
| 430 |
start_time = time.time()
|
| 431 |
|
| 432 |
+
with st.spinner('Eve is thinking...'):
|
| 433 |
chain = load_chatbot()
|
| 434 |
docs = VectorStore.similarity_search(query=query, k=5)
|
| 435 |
with get_openai_callback() as cb:
|
|
|
|
| 443 |
|
| 444 |
# Calculate duration
|
| 445 |
duration = end_time - start_time
|
|
|
|
| 446 |
|
| 447 |
+
st.session_state['chat_history_page2'].append(("Eve", response, "new"))
|
| 448 |
+
st.text(f"Response time: {duration:.2f} seconds")
|
| 449 |
|
| 450 |
|
| 451 |
# Combine chat histories from all pages
|
|
|
|
| 548 |
# Start timing
|
| 549 |
start_time = time.time()
|
| 550 |
|
| 551 |
+
with st.spinner('Eve is thinking...'):
|
| 552 |
chain = load_chatbot()
|
| 553 |
docs = VectorStore.similarity_search(query=query, k=5)
|
| 554 |
with get_openai_callback() as cb:
|
|
|
|
| 562 |
|
| 563 |
# Calculate duration
|
| 564 |
duration = end_time - start_time
|
|
|
|
| 565 |
|
| 566 |
+
st.session_state['chat_history_page3'].append(("Eve", response, "new"))
|
| 567 |
+
st.text(f"Response time: {duration:.2f} seconds")
|
| 568 |
|
| 569 |
# Combine chat histories from all pages
|
| 570 |
all_chat_histories = [
|