Erva Ulusoy commited on
Commit
c520c43
·
1 Parent(s): 7d697ba

added env loading placeholder

Browse files
Files changed (1) hide show
  1. ProtHGT_app.py +15 -1
ProtHGT_app.py CHANGED
@@ -5,7 +5,17 @@ import streamlit.components.v1 as components
5
  import pandas as pd
6
 
7
 
8
- with st.spinner("Please wait while we prepare the environment. This may take up to 10 minutes on the first run..."):
 
 
 
 
 
 
 
 
 
 
9
  # Run setup script if not already executed
10
  if not os.path.exists(".setup_done"):
11
  start_time = time.time()
@@ -15,6 +25,10 @@ with st.spinner("Please wait while we prepare the environment. This may take up
15
  with open(".setup_done", "w") as f:
16
  f.write("done")
17
 
 
 
 
 
18
  from run_prothgt_app import *
19
 
20
  def convert_df(df):
 
5
  import pandas as pd
6
 
7
 
8
+
9
+ with st.spinner("Initializing the environment... This may take up to 10 minutes at the start of each session."):
10
+ # Create a temporary placeholder for the message
11
+ loading_placeholder = st.empty()
12
+
13
+ # Show the info message only while the spinner is active
14
+ loading_placeholder.info("""
15
+ **Note:** This initialization is required at the start of each session.
16
+ Once the app is ready, you can run multiple predictions without re-initializing by clicking the **Reset** button in the sidebar.
17
+ """)
18
+
19
  # Run setup script if not already executed
20
  if not os.path.exists(".setup_done"):
21
  start_time = time.time()
 
25
  with open(".setup_done", "w") as f:
26
  f.write("done")
27
 
28
+ # ❌ Remove the info message after initialization is complete
29
+ loading_placeholder.empty()
30
+
31
+
32
  from run_prothgt_app import *
33
 
34
  def convert_df(df):