duongthienz commited on
Commit
d7f2772
·
verified ·
1 Parent(s): ec2153e

Remove analyze() from load_demo_single

Browse files
Files changed (1) hide show
  1. state.py +3 -7
state.py CHANGED
@@ -270,18 +270,14 @@ def load_annotation_file(fname, fpath):
270
 
271
 
272
  def load_demo_single(demo_path):
273
- """Register and load a single RTTM demo file, then run analyze()."""
274
- import time
275
  dname = demo_path.split("/")[-1]
276
  register_file(dname)
277
  st.session_state.file_paths[dname] = demo_path
278
- start_time = time.time()
279
  with st.spinner("Loading Demo Sample"):
280
  load_annotation_file(dname, demo_path)
281
- with st.spinner("Analyzing Demo Data"):
282
- analyze(dname)
283
- st.success(f"Took {time.time() - start_time:.1f}s to analyze the demo file!")
284
  st.session_state.select_currFile = dname
 
285
  return dname
286
 
287
 
@@ -426,4 +422,4 @@ def analyze(inFileName):
426
  except Exception as e:
427
  print(f"Error in analyze: {e}")
428
  traceback.print_exc()
429
- st.error(f"Debug - analyze() failed: {e}")
 
270
 
271
 
272
  def load_demo_single(demo_path):
273
+ """Register and load a single RTTM demo file, then queue analysis via toggle."""
 
274
  dname = demo_path.split("/")[-1]
275
  register_file(dname)
276
  st.session_state.file_paths[dname] = demo_path
 
277
  with st.spinner("Loading Demo Sample"):
278
  load_annotation_file(dname, demo_path)
 
 
 
279
  st.session_state.select_currFile = dname
280
+ st.session_state.analyzeAllToggle = True
281
  return dname
282
 
283
 
 
422
  except Exception as e:
423
  print(f"Error in analyze: {e}")
424
  traceback.print_exc()
425
+ st.error(f"Debug - analyze() failed: {e}")