Skip to content

Commit

Permalink
fix device
Browse files Browse the repository at this point in the history
  • Loading branch information
Stardust-minus authored Sep 9, 2023
1 parent a6c42d6 commit 40c2fae
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions webui.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import sys, os

if sys.platform == "darwin":
os.environ["PYTORCH_ENABLE_MPS_FALLBACK"] = "1"

import logging

logging.getLogger("numba").setLevel(logging.WARNING)
Expand All @@ -29,6 +25,14 @@

net_g = None

if (
sys.platform == "darwin"
and torch.backends.mps.is_available()
):
device = "mps"
os.environ["PYTORCH_ENABLE_MPS_FALLBACK"] = "1"
else:
device = "cuda"

def get_text(text, language_str, hps):
norm_text, phone, tone, word2ph = clean_text(text, language_str)
Expand Down

0 comments on commit 40c2fae

Please sign in to comment.