Reduce execution time due to the sleep

#1
by eaedk - opened
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -85,9 +85,10 @@ def main():
85
  with st.spinner("Predicting..."):
86
  # Simulate a long-running process
87
  progress_bar = st.progress(0)
88
- for i in range(100):
 
89
  time.sleep(0.1)
90
- progress_bar.progress(i + 1)
91
 
92
  output_df, probabilities = predict_sepsis(input_data)
93
 
 
85
  with st.spinner("Predicting..."):
86
  # Simulate a long-running process
87
  progress_bar = st.progress(0)
88
+ step = 20 # A big step will reduce the execution time
89
+ for i in range(0, 100, step):
90
  time.sleep(0.1)
91
+ progress_bar.progress(i + step)
92
 
93
  output_df, probabilities = predict_sepsis(input_data)
94