czyoung commited on
Commit
af26c0d
·
verified ·
1 Parent(s): c16308c

Update pipeline to use device changing methods

Browse files
Files changed (1) hide show
  1. state.py +2 -2
state.py CHANGED
@@ -519,7 +519,7 @@ def run_analysis_loop(file_names, file_paths_dict):
519
 
520
  # Pull pipeline and move to device for inference
521
  pipeline = st.session_state.pipeline
522
- pipeline.to(pipeline.device)
523
  for i, fname in enumerate(pending):
524
  fpath = file_paths_dict.get(fname, "")
525
  ext = fpath.lower()
@@ -542,7 +542,7 @@ def run_analysis_loop(file_names, file_paths_dict):
542
  analyze(fname)
543
 
544
  # Return to cpu
545
- pipeline.to('cpu')
546
  st.success(f"Analyzed {totalFiles} new file(s) in {time.time() - start_time:.1f}s")
547
  st.session_state.analyzeAllToggle = False
548
  # Rotate uploader key to clear the file uploader widget
 
519
 
520
  # Pull pipeline and move to device for inference
521
  pipeline = st.session_state.pipeline
522
+ pipeline.toDevice()
523
  for i, fname in enumerate(pending):
524
  fpath = file_paths_dict.get(fname, "")
525
  ext = fpath.lower()
 
542
  analyze(fname)
543
 
544
  # Return to cpu
545
+ pipeline.toCPU()
546
  st.success(f"Analyzed {totalFiles} new file(s) in {time.time() - start_time:.1f}s")
547
  st.session_state.analyzeAllToggle = False
548
  # Rotate uploader key to clear the file uploader widget