Update app.py
Browse files
app.py
CHANGED
|
@@ -142,8 +142,8 @@ run_libra.load_model = safe_load_model
|
|
| 142 |
import libra.eval.run_libra as run_libra_module
|
| 143 |
|
| 144 |
# Replace the function in the module BEFORE ccd imports it
|
| 145 |
-
run_libra_module.get_image_tensors_batch = get_image_tensors_batch_cpu
|
| 146 |
-
print('[INFO] Replaced get_image_tensors_batch with CPU-only version')
|
| 147 |
|
| 148 |
# Now import CCD and hook ccd_utils to force CPU for expert models
|
| 149 |
import ccd.ccd_utils as ccd_utils_module
|
|
@@ -153,8 +153,8 @@ print('[INFO] Forced ccd_utils._DEVICE to CPU')
|
|
| 153 |
# Now import CCD module and patch its imported function
|
| 154 |
import ccd.run_ccd as ccd_run_ccd_module
|
| 155 |
# Replace the function that ccd.run_ccd imported
|
| 156 |
-
ccd_run_ccd_module.get_image_tensors_batch = get_image_tensors_batch_cpu
|
| 157 |
-
print('[INFO] Patched ccd.run_ccd.get_image_tensors_batch')
|
| 158 |
|
| 159 |
# Now import the evaluation functions
|
| 160 |
from ccd import ccd_eval as _original_ccd_eval, run_eval
|
|
|
|
| 142 |
import libra.eval.run_libra as run_libra_module
|
| 143 |
|
| 144 |
# Replace the function in the module BEFORE ccd imports it
|
| 145 |
+
# run_libra_module.get_image_tensors_batch = get_image_tensors_batch_cpu
|
| 146 |
+
# print('[INFO] Replaced get_image_tensors_batch with CPU-only version')
|
| 147 |
|
| 148 |
# Now import CCD and hook ccd_utils to force CPU for expert models
|
| 149 |
import ccd.ccd_utils as ccd_utils_module
|
|
|
|
| 153 |
# Now import CCD module and patch its imported function
|
| 154 |
import ccd.run_ccd as ccd_run_ccd_module
|
| 155 |
# Replace the function that ccd.run_ccd imported
|
| 156 |
+
# ccd_run_ccd_module.get_image_tensors_batch = get_image_tensors_batch_cpu
|
| 157 |
+
# print('[INFO] Patched ccd.run_ccd.get_image_tensors_batch')
|
| 158 |
|
| 159 |
# Now import the evaluation functions
|
| 160 |
from ccd import ccd_eval as _original_ccd_eval, run_eval
|