mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix: audit fixes for cross-platform correctness
- Fix NameError in restore.py: face enhancement loop used undefined variable `i`, now uses enumerate() - Fix gpu.py ONNX fallback: previous smoke-test with empty bytes always raised, making GPU detection unreachable via the ONNX path. Now uses nvidia-smi hardware check after confirming CUDA EP is compiled in — works on Linux, Windows, and gracefully fails on macOS - Fix cpu_fallback_packages stripping CUDA-specific index URLs when replacing paddlepaddle-gpu with paddlepaddle for CPU-only systems Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -90,8 +90,11 @@ def cpu_fallback_packages(packages: list[str]) -> list[str]:
|
||||
|
||||
name = pkg.split("==")[0].split(">=")[0].split("[")[0].strip()
|
||||
if name in replacements:
|
||||
version = pkg[len(name):] # e.g. "==1.20.1"
|
||||
result.append(replacements[name] + version)
|
||||
# Extract only the version spec, drop any inline flags
|
||||
# (e.g. "--extra-index-url https://...cu126/" is GPU-specific)
|
||||
tokens = pkg.split()
|
||||
version_token = tokens[0][len(name):] # e.g. ">=3.2.1"
|
||||
result.append(replacements[name] + version_token)
|
||||
else:
|
||||
result.append(pkg)
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user