chahui commited on
Commit
d974843
·
verified ·
1 Parent(s): a62d7b6

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -0
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: