Spaces:
Running on Zero
Running on Zero
Fix basicsr/realesrgan/gfpgan build: move to runtime --no-build-isolation install (setup.py imports torch)
Browse files- app.py +11 -4
- requirements.txt +4 -6
app.py
CHANGED
|
@@ -29,13 +29,20 @@ from pathlib import Path
|
|
| 29 |
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 30 |
_RUNTIME_PKG_MARKER = Path("/tmp/.runtime_pkgs_installed")
|
| 31 |
|
| 32 |
-
# 1. Packages requiring --no-build-isolation
|
| 33 |
-
#
|
| 34 |
-
#
|
| 35 |
-
#
|
|
|
|
|
|
|
| 36 |
_NO_ISOLATION_PACKAGES = [
|
| 37 |
"hmr2 @ git+https://github.com/shubham-goel/4D-Humans.git@efe18deff163b29dff87ddbd575fa29b716a356c",
|
| 38 |
"skel @ git+https://github.com/MarilynKeller/SKEL.git@c32cf16581295bff19399379efe5b776d707cd95",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
]
|
| 40 |
|
| 41 |
# 2. Packages with over-pinned deps that conflict with our stack; install --no-deps
|
|
|
|
| 29 |
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 30 |
_RUNTIME_PKG_MARKER = Path("/tmp/.runtime_pkgs_installed")
|
| 31 |
|
| 32 |
+
# 1. Packages requiring --no-build-isolation
|
| 33 |
+
# - hmr2/skel: declare `chumpy @ git+...` direct-ref dep; chumpy's setup.py does
|
| 34 |
+
# `from pip._internal.req import parse_requirements` which fails in isolated builds.
|
| 35 |
+
# - basicsr/realesrgan/gfpgan/facexlib/face-alignment: setup.py imports torch to read
|
| 36 |
+
# __version__, which fails when torch is not yet present in the isolated build env.
|
| 37 |
+
# Do NOT list chumpy explicitly β hmr2 pulls it as a transitive dep.
|
| 38 |
_NO_ISOLATION_PACKAGES = [
|
| 39 |
"hmr2 @ git+https://github.com/shubham-goel/4D-Humans.git@efe18deff163b29dff87ddbd575fa29b716a356c",
|
| 40 |
"skel @ git+https://github.com/MarilynKeller/SKEL.git@c32cf16581295bff19399379efe5b776d707cd95",
|
| 41 |
+
"basicsr",
|
| 42 |
+
"realesrgan",
|
| 43 |
+
"gfpgan",
|
| 44 |
+
"facexlib",
|
| 45 |
+
"face-alignment",
|
| 46 |
]
|
| 47 |
|
| 48 |
# 2. Packages with over-pinned deps that conflict with our stack; install --no-deps
|
requirements.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
# HuggingFace ZeroGPU Space β Gradio SDK [cache-bust:
|
| 2 |
spaces
|
| 3 |
numpy>=2
|
| 4 |
|
|
@@ -47,11 +47,9 @@ kornia
|
|
| 47 |
# Face enhancement
|
| 48 |
insightface
|
| 49 |
onnxruntime-gpu
|
| 50 |
-
basicsr
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
facexlib
|
| 54 |
-
face-alignment
|
| 55 |
|
| 56 |
# Surface enhancement
|
| 57 |
# stablenormal: installed at runtime with --no-deps (it pins diffusers==0.28.0)
|
|
|
|
| 1 |
+
# HuggingFace ZeroGPU Space β Gradio SDK [cache-bust: 5]
|
| 2 |
spaces
|
| 3 |
numpy>=2
|
| 4 |
|
|
|
|
| 47 |
# Face enhancement
|
| 48 |
insightface
|
| 49 |
onnxruntime-gpu
|
| 50 |
+
# basicsr/realesrgan/gfpgan/facexlib/face-alignment: installed at runtime in app.py
|
| 51 |
+
# with --no-build-isolation (their setup.py imports torch at build time, which fails
|
| 52 |
+
# in pip's isolated build env where torch is not yet installed)
|
|
|
|
|
|
|
| 53 |
|
| 54 |
# Surface enhancement
|
| 55 |
# stablenormal: installed at runtime with --no-deps (it pins diffusers==0.28.0)
|