Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
@@ -21,19 +21,14 @@ st.set_page_config(page_title="Tall Tree Health",
|
|
21 |
with open("styles/styles.css") as css:
|
22 |
st.markdown(f"<style>{css.read()}</style>", unsafe_allow_html=True)
|
23 |
|
24 |
-
# Error message
|
25 |
base_error_message = (
|
26 |
-
"
|
27 |
"Please refresh the page or try again later.\n\n"
|
28 |
"If the error persists, please contact us at "
|
29 |
"[Tall Tree Health](https://www.talltreehealth.ca/contact-us)."
|
30 |
)
|
31 |
|
32 |
-
openai_api_error_message = (
|
33 |
-
"We're sorry, but you've reached the maximum number of requests allowed per session.\n\n"
|
34 |
-
"Please refresh the page to continue using the app."
|
35 |
-
)
|
36 |
-
|
37 |
# Get chain and memory
|
38 |
|
39 |
|
@@ -117,7 +112,7 @@ if prompt:
|
|
117 |
st.session_state.run_id = cb.traced_runs[0].id
|
118 |
message_placeholder.markdown(partial_message)
|
119 |
except openai.BadRequestError:
|
120 |
-
st.warning(
|
121 |
st.stop()
|
122 |
except Exception as e:
|
123 |
st.warning(base_error_message, icon="π")
|
|
|
21 |
with open("styles/styles.css") as css:
|
22 |
st.markdown(f"<style>{css.read()}</style>", unsafe_allow_html=True)
|
23 |
|
24 |
+
# Error message template
|
25 |
base_error_message = (
|
26 |
+
"Something went wrong while processing your request. "
|
27 |
"Please refresh the page or try again later.\n\n"
|
28 |
"If the error persists, please contact us at "
|
29 |
"[Tall Tree Health](https://www.talltreehealth.ca/contact-us)."
|
30 |
)
|
31 |
|
|
|
|
|
|
|
|
|
|
|
32 |
# Get chain and memory
|
33 |
|
34 |
|
|
|
112 |
st.session_state.run_id = cb.traced_runs[0].id
|
113 |
message_placeholder.markdown(partial_message)
|
114 |
except openai.BadRequestError:
|
115 |
+
st.warning(base_error_message, icon="π")
|
116 |
st.stop()
|
117 |
except Exception as e:
|
118 |
st.warning(base_error_message, icon="π")
|