Add files via upload

This commit is contained in:
Anjok07
2022-12-27 21:38:17 -06:00
committed by GitHub
parent f21bbb404f
commit 15e134bd56
2 changed files with 20 additions and 3 deletions

View File

@@ -370,8 +370,12 @@ class SeperateDemucs(SeperateAttributes):
self.load_cached_sources(is_4_stem_demucs=True)
else:
self.start_inference()
if self.is_gpu_conversion >= 0:
self.device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')
if OPERATING_SYSTEM == 'Darwin':
self.device = torch.device('mps' if torch.backends.mps.is_available() and self.demucs_version in [DEMUCS_V1, DEMUCS_V2] and 'Tasnet' not in self.model_name else 'cpu')
else:
self.device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')
else:
self.device = torch.device('cpu')