fix: centralize OPENVINO_PROVIDER_CONFIG and log SystemExit

Address Sourcery review feedback on PR #1879:

- Move OPENVINO_PROVIDER_CONFIG from _onnx_enhancer.py to
  platform_info.py (a leaf module with no modules.* imports), so
  the enhancer and face_swapper no longer import each other just to
  share a constant. _onnx_enhancer re-exports it; face_swapper now
  imports it at module top level instead of inside get_face_swapper().
- Narrow run.py's SystemExit handling: catch SystemExit separately
  and print a [startup] message so the failure is visible instead
  of being swallowed alongside ImportError/FileNotFoundError.
This commit is contained in:
dunegym
2026-07-12 15:16:18 +08:00
parent 7d2d7fb1f3
commit 14ba4f9c0b
4 changed files with 26 additions and 11 deletions
+1 -3
View File
@@ -18,6 +18,7 @@ from modules.utilities import (
)
from modules.cluster_analysis import find_closest_centroid
from modules.gpu_processing import gpu_gaussian_blur, gpu_sharpen, gpu_add_weighted, gpu_resize
from modules.platform_info import OPENVINO_PROVIDER_CONFIG
import os
from collections import deque
import time
@@ -271,9 +272,6 @@ def get_face_swapper() -> Any:
# fastest on modern GPUs (Blackwell/sm_120).
providers_config.append(p)
elif p == "OpenVINOExecutionProvider":
from modules.processors.frame._onnx_enhancer import (
OPENVINO_PROVIDER_CONFIG,
)
providers_config.append(OPENVINO_PROVIDER_CONFIG)
else:
providers_config.append(p)