Update BrainBot.py
Browse files- BrainBot.py +4 -4
BrainBot.py
CHANGED
|
@@ -89,7 +89,7 @@ with col3:
|
|
| 89 |
st.session_state['api_key_flag'] = True
|
| 90 |
st.experimental_rerun()
|
| 91 |
except Exception as e:
|
| 92 |
-
st.switch_page("error.py")
|
| 93 |
with col4:
|
| 94 |
if llm == "GROQ" or "api_key_flag" in st.session_state:
|
| 95 |
# Select to upload file, image, or link to chat with them
|
|
@@ -137,7 +137,7 @@ if uploaded_file is not None:
|
|
| 137 |
st.session_state['uploaded_file'] = True
|
| 138 |
st.switch_page("pages/File-chat.py")
|
| 139 |
except Exception as e:
|
| 140 |
-
st.switch_page("error.py")
|
| 141 |
|
| 142 |
## IMAGE
|
| 143 |
## -------------------------------------------------------------------------------------------
|
|
@@ -148,7 +148,7 @@ if uploaded_image is not None:
|
|
| 148 |
# Save uploaded image to a temporary file
|
| 149 |
temp_img_path = save_uploaded_image(uploaded_image)
|
| 150 |
except Exception as e:
|
| 151 |
-
st.switch_page("error.py")
|
| 152 |
|
| 153 |
st.session_state['temp_img_path'] = temp_img_path
|
| 154 |
st.session_state['current_image'] = uploaded_image.name
|
|
@@ -176,6 +176,6 @@ if website_link is not None:
|
|
| 176 |
st.session_state['uploaded_link'] = True
|
| 177 |
st.switch_page("pages/Web-chat.py")
|
| 178 |
except Exception as e:
|
| 179 |
-
st.switch_page("error.py")
|
| 180 |
else:
|
| 181 |
st.error("Invalid URL. Please enter a valid URL.")
|
|
|
|
| 89 |
st.session_state['api_key_flag'] = True
|
| 90 |
st.experimental_rerun()
|
| 91 |
except Exception as e:
|
| 92 |
+
st.switch_page("pages/error.py")
|
| 93 |
with col4:
|
| 94 |
if llm == "GROQ" or "api_key_flag" in st.session_state:
|
| 95 |
# Select to upload file, image, or link to chat with them
|
|
|
|
| 137 |
st.session_state['uploaded_file'] = True
|
| 138 |
st.switch_page("pages/File-chat.py")
|
| 139 |
except Exception as e:
|
| 140 |
+
st.switch_page("pages/error.py")
|
| 141 |
|
| 142 |
## IMAGE
|
| 143 |
## -------------------------------------------------------------------------------------------
|
|
|
|
| 148 |
# Save uploaded image to a temporary file
|
| 149 |
temp_img_path = save_uploaded_image(uploaded_image)
|
| 150 |
except Exception as e:
|
| 151 |
+
st.switch_page("pages/error.py")
|
| 152 |
|
| 153 |
st.session_state['temp_img_path'] = temp_img_path
|
| 154 |
st.session_state['current_image'] = uploaded_image.name
|
|
|
|
| 176 |
st.session_state['uploaded_link'] = True
|
| 177 |
st.switch_page("pages/Web-chat.py")
|
| 178 |
except Exception as e:
|
| 179 |
+
st.switch_page("pages/error.py")
|
| 180 |
else:
|
| 181 |
st.error("Invalid URL. Please enter a valid URL.")
|