Spaces:
Paused
Paused
Fix: evict pip-installed trellis2 stub from sys.modules before loading vendored copy
Browse fileso_voxel's wheel METADATA lists trellis2 as a dependency, so pip installs a
PyPI trellis2 package that ends up in sys.modules with the wrong __path__.
importlib.import_module('.models', 'trellis2') then fails with ModuleNotFoundError
because it searches the PyPI package path, not our TRELLIS.2/trellis2/.
Fix: clear all trellis2/* entries from sys.modules after sys.path.insert so
the subsequent 'import trellis2' loads from our vendored directory.
38 unmodified lines3940414243444538 unmodified linesos.environ.setdefault("FLEX_GEMM_AUTOTUNER_VERBOSE", "0")if str(_TRELLIS_DIR) not in sys.path:sys.path.insert(0, str(_TRELLIS_DIR))import trellis2 # noqa: E402, F401 — fully initialise before any src.stages importimport gradio as grimport spaces # HF ZeroGPU38 unmodified lines39404142434445464748495038 unmodified linesos.environ.setdefault("FLEX_GEMM_AUTOTUNER_VERBOSE", "0")if str(_TRELLIS_DIR) not in sys.path:sys.path.insert(0, str(_TRELLIS_DIR))# o_voxel/flex_gemm wheels list 'trellis2' as a pip dependency, so pip# installs a PyPI trellis2 stub that lands in sys.modules with the wrong# __path__. Evict it so our vendored copy is loaded instead.for _k in [k for k in sys.modules if k == "trellis2" or k.startswith("trellis2.")]:del sys.modules[_k]import trellis2 # noqa: E402, F401 — loads our TRELLIS.2/trellis2/ copyimport gradio as grimport spaces # HF ZeroGPU
app.py+6-1