AIEcosystem commited on
Commit
b45fd1d
·
verified ·
1 Parent(s): cc563f7

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +14 -4
src/streamlit_app.py CHANGED
@@ -73,7 +73,9 @@ Results are presented in easy-to-read tables, visualized in an interactive tree
73
 
74
  **Supported Languages:** English
75
 
76
- **Technical issues:** If your connection times out, please refresh the page or reopen the app's URL. For any errors or inquiries, please contact us at [email protected]""")
 
 
77
 
78
  with st.sidebar:
79
  st.write("Use the following code to embed the StoryCraft web app on your website. Feel free to adjust the width and height values to fit your page.")
@@ -290,13 +292,21 @@ if st.session_state.show_results:
290
  mime="application/zip",
291
  )
292
 
 
293
  if comet_initialized:
294
- experiment.log_figure(figure=fig_treemap, figure_name="entity_treemap_categories")
295
- experiment.end()
 
 
 
 
 
 
 
296
 
297
  else: # If df is empty
298
  st.warning("No entities were found in the provided text.")
299
-
300
  st.text("")
301
  st.text("")
302
  st.info(f"Results processed in **{st.session_state.elapsed_time:.2f} seconds**.")
 
73
 
74
  **Supported Languages:** English
75
 
76
+ **Technical issues:** If your connection times out, please refresh the page or reopen the app's URL.
77
+
78
+ For any errors or inquiries, please contact us at [email protected]""")
79
 
80
  with st.sidebar:
81
  st.write("Use the following code to embed the StoryCraft web app on your website. Feel free to adjust the width and height values to fit your page.")
 
292
  mime="application/zip",
293
  )
294
 
295
+ # Moved the Comet ML logging block to the correct place
296
  if comet_initialized:
297
+ # Check if df is not empty before trying to log
298
+ if not df.empty:
299
+ experiment = Experiment(
300
+ api_key=COMET_API_KEY,
301
+ workspace=COMET_WORKSPACE,
302
+ project_name=COMET_PROJECT_NAME,
303
+ )
304
+ experiment.log_figure(figure=fig_treemap, figure_name="entity_treemap_categories")
305
+ experiment.end()
306
 
307
  else: # If df is empty
308
  st.warning("No entities were found in the provided text.")
309
+
310
  st.text("")
311
  st.text("")
312
  st.info(f"Results processed in **{st.session_state.elapsed_time:.2f} seconds**.")