Spaces:
Sleeping
Sleeping
Update pipeline to use device changing methods
Browse files
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.
|
| 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.
|
| 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
|