Spaces:
Configuration error
Configuration error
Upload app.py
Browse files
app.py
CHANGED
|
@@ -9,24 +9,21 @@ os.environ.setdefault("CUDA_VISIBLE_DEVICES", "") # force CPU
|
|
| 9 |
os.environ.setdefault("WORLDGEN_DISABLE_EVAL", "1") # avoid KNN/eval paths if supported
|
| 10 |
os.environ.setdefault("GRADIO_TEMP_DIR", "/tmp/gradio") # centralize gradio cache
|
| 11 |
|
| 12 |
-
import gradio as gr
|
| 13 |
-
import torch
|
| 14 |
-
from worldgen import WorldGen
|
| 15 |
-
|
| 16 |
-
# Lazy init to avoid long cold start
|
| 17 |
-
_wg = None
|
| 18 |
-
|
| 19 |
-
|
| 20 |
import nunchaku.utils
|
| 21 |
-
|
| 22 |
def safe_get_precision():
|
| 23 |
import torch
|
| 24 |
if not torch.cuda.is_available():
|
| 25 |
-
return
|
| 26 |
return nunchaku.utils.get_precision()
|
| 27 |
-
|
| 28 |
nunchaku.utils.get_precision = safe_get_precision
|
| 29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
def get_worldgen():
|
| 31 |
global _wg
|
| 32 |
if _wg is None:
|
|
|
|
| 9 |
os.environ.setdefault("WORLDGEN_DISABLE_EVAL", "1") # avoid KNN/eval paths if supported
|
| 10 |
os.environ.setdefault("GRADIO_TEMP_DIR", "/tmp/gradio") # centralize gradio cache
|
| 11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
import nunchaku.utils
|
|
|
|
| 13 |
def safe_get_precision():
|
| 14 |
import torch
|
| 15 |
if not torch.cuda.is_available():
|
| 16 |
+
return 'fp32'
|
| 17 |
return nunchaku.utils.get_precision()
|
|
|
|
| 18 |
nunchaku.utils.get_precision = safe_get_precision
|
| 19 |
|
| 20 |
+
import gradio as gr
|
| 21 |
+
import torch
|
| 22 |
+
from worldgen import WorldGen
|
| 23 |
+
|
| 24 |
+
# Lazy init to avoid long cold start
|
| 25 |
+
_wg = None
|
| 26 |
+
|
| 27 |
def get_worldgen():
|
| 28 |
global _wg
|
| 29 |
if _wg is None:
|