Update BrainBot.py
Browse files- BrainBot.py +0 -7
BrainBot.py
CHANGED
|
@@ -11,9 +11,6 @@ with open('styles.css') as f:
|
|
| 11 |
|
| 12 |
st.markdown(f'<style>{css}</style>', unsafe_allow_html=True)
|
| 13 |
|
| 14 |
-
# Setup Logging
|
| 15 |
-
setup_logging()
|
| 16 |
-
|
| 17 |
## FUNCTIONS
|
| 18 |
## -------------------------------------------------------------------------------------------
|
| 19 |
# Function to save the uploaded file as a temporary file and return its path.
|
|
@@ -93,7 +90,6 @@ with col3:
|
|
| 93 |
st.session_state['api_key_flag'] = True
|
| 94 |
st.experimental_rerun()
|
| 95 |
except Exception as e:
|
| 96 |
-
log_error(str(e))
|
| 97 |
st.switch_page("error.py")
|
| 98 |
with col4:
|
| 99 |
if llm == "GROQ" or "api_key_flag" in st.session_state:
|
|
@@ -142,7 +138,6 @@ if uploaded_file is not None:
|
|
| 142 |
st.session_state['uploaded_file'] = True
|
| 143 |
st.switch_page("pages/File-chat.py")
|
| 144 |
except Exception as e:
|
| 145 |
-
log_error(str(e))
|
| 146 |
st.switch_page("error.py")
|
| 147 |
|
| 148 |
## IMAGE
|
|
@@ -154,7 +149,6 @@ if uploaded_image is not None:
|
|
| 154 |
# Save uploaded image to a temporary file
|
| 155 |
temp_img_path = save_uploaded_image(uploaded_image)
|
| 156 |
except Exception as e:
|
| 157 |
-
log_error(str(e))
|
| 158 |
st.switch_page("error.py")
|
| 159 |
|
| 160 |
st.session_state['temp_img_path'] = temp_img_path
|
|
@@ -183,7 +177,6 @@ if website_link is not None:
|
|
| 183 |
st.session_state['uploaded_link'] = True
|
| 184 |
st.switch_page("pages/Web-chat.py")
|
| 185 |
except Exception as e:
|
| 186 |
-
log_error(str(e))
|
| 187 |
st.switch_page("error.py")
|
| 188 |
else:
|
| 189 |
st.error("Invalid URL. Please enter a valid URL.")
|
|
|
|
| 11 |
|
| 12 |
st.markdown(f'<style>{css}</style>', unsafe_allow_html=True)
|
| 13 |
|
|
|
|
|
|
|
|
|
|
| 14 |
## FUNCTIONS
|
| 15 |
## -------------------------------------------------------------------------------------------
|
| 16 |
# Function to save the uploaded file as a temporary file and return its path.
|
|
|
|
| 90 |
st.session_state['api_key_flag'] = True
|
| 91 |
st.experimental_rerun()
|
| 92 |
except Exception as e:
|
|
|
|
| 93 |
st.switch_page("error.py")
|
| 94 |
with col4:
|
| 95 |
if llm == "GROQ" or "api_key_flag" in st.session_state:
|
|
|
|
| 138 |
st.session_state['uploaded_file'] = True
|
| 139 |
st.switch_page("pages/File-chat.py")
|
| 140 |
except Exception as e:
|
|
|
|
| 141 |
st.switch_page("error.py")
|
| 142 |
|
| 143 |
## IMAGE
|
|
|
|
| 149 |
# Save uploaded image to a temporary file
|
| 150 |
temp_img_path = save_uploaded_image(uploaded_image)
|
| 151 |
except Exception as e:
|
|
|
|
| 152 |
st.switch_page("error.py")
|
| 153 |
|
| 154 |
st.session_state['temp_img_path'] = temp_img_path
|
|
|
|
| 177 |
st.session_state['uploaded_link'] = True
|
| 178 |
st.switch_page("pages/Web-chat.py")
|
| 179 |
except Exception as e:
|
|
|
|
| 180 |
st.switch_page("error.py")
|
| 181 |
else:
|
| 182 |
st.error("Invalid URL. Please enter a valid URL.")
|