cocktailpeanut commited on
Commit
bb0b433
1 Parent(s): 9766f45
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -61,7 +61,13 @@ if opt.resume is not None:
61
  else:
62
  print(f'[WARN] model randomly initialized, are you sure?')
63
 
64
- device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
 
 
 
 
 
 
65
  model = model.half().to(device)
66
  model.eval()
67
 
@@ -268,4 +274,4 @@ with block:
268
  label='Text-to-3D Examples'
269
  )
270
 
271
- block.launch()
 
61
  else:
62
  print(f'[WARN] model randomly initialized, are you sure?')
63
 
64
+ if torch.backends.mps.is_available():
65
+ device = "mps"
66
+ elif torch.cuda.is_available():
67
+ device = "cuda"
68
+ else:
69
+ device = "cpu"
70
+ #device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
71
  model = model.half().to(device)
72
  model.eval()
73
 
 
274
  label='Text-to-3D Examples'
275
  )
276
 
277
+ block.launch()