cocktailpeanut commited on
Commit
eb8e39b
·
1 Parent(s): 0807a71
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -12,7 +12,13 @@ from pipeline import build_audiosep
12
 
13
  CHECKPOINTS_DIR = Path("checkpoint")
14
 
15
- DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu")
 
 
 
 
 
 
16
 
17
  # The model will be loaded in the future
18
  MODEL_NAME = CHECKPOINTS_DIR / "audiosep_base_4M_steps.ckpt"
 
12
 
13
  CHECKPOINTS_DIR = Path("checkpoint")
14
 
15
+ #DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu")
16
+ if torch.backends.mps.is_available():
17
+ DEVICE = "mps"
18
+ elif torch.cuda.is_available():
19
+ DEVICE = "cuda"
20
+ else:
21
+ DEVICE = "cpu"
22
 
23
  # The model will be loaded in the future
24
  MODEL_NAME = CHECKPOINTS_DIR / "audiosep_base_4M_steps.ckpt"