Maria Tsilimos commited on
Commit
54f07b4
·
unverified ·
1 Parent(s): 8d11877

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -240,12 +240,15 @@ if source_type:
240
  mime="application/zip",)
241
 
242
 
243
- if comet_initialized and experiment: # Ensure experiment exists before ending
244
- experiment.end()
245
  else:
246
  st.warning("No meaningful text found to process. Please enter a URL or text.")
 
247
 
248
- except requests.exceptions.RequestException as e:
249
- st.error(f"Error fetching the URL: {e}. Please check the URL and your internet connection.")
 
 
 
250
 
251
  st.write(f"Number of times you requested results: **{st.session_state['source_type_attempts']}/{max_attempts}**")
 
240
  mime="application/zip",)
241
 
242
 
243
+ st.divider()
 
244
  else:
245
  st.warning("No meaningful text found to process. Please enter a URL or text.")
246
+
247
 
248
+ except Exception as e:
249
+ st.error(f"An unexpected error occurred: {e}")
250
+ finally:
251
+ if comet_initialized and experiment:
252
+ experiment.end()
253
 
254
  st.write(f"Number of times you requested results: **{st.session_state['source_type_attempts']}/{max_attempts}**")