Skip to content

Commit

Permalink
support mps, optimized device selection
Browse files Browse the repository at this point in the history
  • Loading branch information
Wu Zichen committed Jan 24, 2024
1 parent cb9d8fe commit a8e6034
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion GPT_SoVITS/inference_webui.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,13 @@
from tools.i18n.i18n import I18nAuto
i18n = I18nAuto()

device = "cuda"
if torch.cuda.is_available():
device = "cuda"
elif torch.mps.is_available():
device = "mps"
else:
device = "cpu"

tokenizer = AutoTokenizer.from_pretrained(bert_path)
bert_model = AutoModelForMaskedLM.from_pretrained(bert_path)
if is_half == True:
Expand Down

0 comments on commit a8e6034

Please sign in to comment.