xinjjj commited on
Commit
79cd7ff
·
1 Parent(s): 4552c66

fix: re-import spaces BEFORE trellis/warp imports (spaces 0.50 strict check)

Browse files
Files changed (1) hide show
  1. common.py +9 -4
common.py CHANGED
@@ -14,18 +14,23 @@
14
  # implied. See the License for the specific language governing
15
  # permissions and limitations under the License.
16
 
 
 
 
 
 
 
 
 
 
17
  from embodied_gen.utils.monkey_patch.gradio import (
18
  _patch_open3d_cuda_device_count_bug,
19
- _patch_spaces_zerogpu_logs,
20
  )
21
  from embodied_gen.utils.monkey_patch.trellis import monkey_path_trellis
22
 
23
- _patch_spaces_zerogpu_logs() # MUST be before `import spaces`
24
  _patch_open3d_cuda_device_count_bug()
25
  monkey_path_trellis()
26
 
27
- import spaces # noqa: E402
28
-
29
  import gc
30
  import logging
31
  import os
 
14
  # implied. See the License for the specific language governing
15
  # permissions and limitations under the License.
16
 
17
+ # spaces 0.50 raises if CUDA was initialized before `import spaces`,
18
+ # so the zerogpu-log injection (which touches site-packages files only)
19
+ # must run first, then `import spaces`, then everything else.
20
+ from embodied_gen.utils.monkey_patch.gradio import _patch_spaces_zerogpu_logs
21
+
22
+ _patch_spaces_zerogpu_logs()
23
+
24
+ import spaces # noqa: E402
25
+
26
  from embodied_gen.utils.monkey_patch.gradio import (
27
  _patch_open3d_cuda_device_count_bug,
 
28
  )
29
  from embodied_gen.utils.monkey_patch.trellis import monkey_path_trellis
30
 
 
31
  _patch_open3d_cuda_device_count_bug()
32
  monkey_path_trellis()
33
 
 
 
34
  import gc
35
  import logging
36
  import os