mirror of
https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI.git
synced 2026-01-20 02:51:09 +00:00
Format code (#624)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
04d7813486
commit
fad31f24f5
@@ -58,12 +58,13 @@ class Config:
|
||||
cmd_opts.noparallel,
|
||||
cmd_opts.noautoopen,
|
||||
)
|
||||
|
||||
|
||||
# has_mps is only available in nightly pytorch (for now) and MasOS 12.3+.
|
||||
# check `getattr` and try it for compatibility
|
||||
@staticmethod
|
||||
def has_mps() -> bool:
|
||||
if not torch.backends.mps.is_available(): return False
|
||||
if not torch.backends.mps.is_available():
|
||||
return False
|
||||
try:
|
||||
torch.zeros(1).to(torch.device("mps"))
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user