andrew3d commited on
Commit
787d8e6
Β·
verified Β·
1 Parent(s): be08e83

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -29,10 +29,12 @@
29
 
30
  import gradio as gr
31
  import os
32
- os.environ['SPCONV_ALGO'] = 'native'
33
- # Hi3DGen uses an attention backend that defaults to 'xformers', which requires an extra
34
- # dependency not installed in this Space. Override the backend to use 'sdpa' instead.
35
- os.environ['ATTN_BACKEND'] = 'sdpa'
 
 
36
  from typing import *
37
  import torch
38
  import numpy as np
 
29
 
30
  import gradio as gr
31
  import os
32
+
33
+ # ---- Force CPU-only environment globally ----
34
+ os.environ["CUDA_VISIBLE_DEVICES"] = "-1" # hide any GPUs from torch
35
+ os.environ.setdefault("ATTN_BACKEND", "sdpa") # avoid xformers
36
+ os.environ.setdefault("SPCONV_ALGO", "native") # safe sparseconv algo
37
+ # ---------------------------------------------
38
  from typing import *
39
  import torch
40
  import numpy as np