Spaces:
Configuration error
Configuration error
Upload app.py
Browse files
app.py
CHANGED
|
@@ -16,6 +16,17 @@ from worldgen import WorldGen
|
|
| 16 |
# Lazy init to avoid long cold start
|
| 17 |
_wg = None
|
| 18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
def get_worldgen():
|
| 20 |
global _wg
|
| 21 |
if _wg is None:
|
|
|
|
| 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 "fp32"
|
| 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:
|