Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -425,6 +425,9 @@ def page2():
|
|
425 |
|
426 |
# Start timing
|
427 |
start_time = time.time()
|
|
|
|
|
|
|
428 |
|
429 |
with st.spinner('Eve denkt über Ihre Frage nach...'):
|
430 |
chain = load_chatbot()
|
@@ -460,7 +463,7 @@ def page2():
|
|
460 |
for chat in new_messages:
|
461 |
background_color = "#ffeecf" if chat[2] == "new" else "#ffeecf" if chat[0] == "User" else "#ffeecf"
|
462 |
new_messages_placeholder.markdown(f"<div style='background-color: {background_color}; padding: 10px; border-radius: 10px; margin: 10px;'>{chat[0]}: {chat[1]}</div>", unsafe_allow_html=True)
|
463 |
-
|
464 |
|
465 |
# Clear the input field after the query is made
|
466 |
query = ""
|
@@ -544,6 +547,8 @@ def page3():
|
|
544 |
|
545 |
# Start timing
|
546 |
start_time = time.time()
|
|
|
|
|
547 |
|
548 |
with st.spinner('Eve denkt über Ihre Frage nach...'):
|
549 |
chain = load_chatbot()
|
@@ -561,7 +566,6 @@ def page3():
|
|
561 |
duration = end_time - start_time
|
562 |
|
563 |
st.session_state['chat_history_page3'].append(("Eve", response, "new"))
|
564 |
-
st.text(f"Response time: {duration:.2f} seconds")
|
565 |
|
566 |
# Combine chat histories from all pages
|
567 |
all_chat_histories = [
|
@@ -579,8 +583,10 @@ def page3():
|
|
579 |
for chat in new_messages:
|
580 |
background_color = "#ffeecf" if chat[2] == "new" else "#ffeecf" if chat[0] == "User" else "#ffeecf"
|
581 |
new_messages_placeholder.markdown(f"<div style='background-color: {background_color}; padding: 10px; border-radius: 10px; margin: 10px;'>{chat[0]}: {chat[1]}</div>", unsafe_allow_html=True)
|
|
|
|
|
|
|
582 |
|
583 |
-
|
584 |
|
585 |
# Clear the input field after the query is made
|
586 |
query = ""
|
|
|
425 |
|
426 |
# Start timing
|
427 |
start_time = time.time()
|
428 |
+
|
429 |
+
# Create a placeholder for the response time
|
430 |
+
response_time_placeholder = st.empty()
|
431 |
|
432 |
with st.spinner('Eve denkt über Ihre Frage nach...'):
|
433 |
chain = load_chatbot()
|
|
|
463 |
for chat in new_messages:
|
464 |
background_color = "#ffeecf" if chat[2] == "new" else "#ffeecf" if chat[0] == "User" else "#ffeecf"
|
465 |
new_messages_placeholder.markdown(f"<div style='background-color: {background_color}; padding: 10px; border-radius: 10px; margin: 10px;'>{chat[0]}: {chat[1]}</div>", unsafe_allow_html=True)
|
466 |
+
|
467 |
|
468 |
# Clear the input field after the query is made
|
469 |
query = ""
|
|
|
547 |
|
548 |
# Start timing
|
549 |
start_time = time.time()
|
550 |
+
# Create a placeholder for the response time
|
551 |
+
response_time_placeholder = st.empty()
|
552 |
|
553 |
with st.spinner('Eve denkt über Ihre Frage nach...'):
|
554 |
chain = load_chatbot()
|
|
|
566 |
duration = end_time - start_time
|
567 |
|
568 |
st.session_state['chat_history_page3'].append(("Eve", response, "new"))
|
|
|
569 |
|
570 |
# Combine chat histories from all pages
|
571 |
all_chat_histories = [
|
|
|
583 |
for chat in new_messages:
|
584 |
background_color = "#ffeecf" if chat[2] == "new" else "#ffeecf" if chat[0] == "User" else "#ffeecf"
|
585 |
new_messages_placeholder.markdown(f"<div style='background-color: {background_color}; padding: 10px; border-radius: 10px; margin: 10px;'>{chat[0]}: {chat[1]}</div>", unsafe_allow_html=True)
|
586 |
+
|
587 |
+
# Update the response time placeholder after the messages are displayed
|
588 |
+
response_time_placeholder.text(f"Response time: {duration:.2f} seconds")
|
589 |
|
|
|
590 |
|
591 |
# Clear the input field after the query is made
|
592 |
query = ""
|