Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion melo/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@
import torch.nn as nn
from tqdm import tqdm
import torch

torch_npu_tag =False
try:
import torch_npu
torch_npu_tag =True
except:

pass
from . import utils
from . import commons
from .models import SynthesizerTrn
Expand All @@ -28,9 +34,12 @@ def __init__(self,
if device == 'auto':
device = 'cpu'
if torch.cuda.is_available(): device = 'cuda'
elif torch_npu_tag and torch_npu.is_available():device = 'npu'
if torch.backends.mps.is_available(): device = 'mps'
if 'cuda' in device:
assert torch.cuda.is_available()
if 'npu' in device:
assert torch_npu.is_available()

# config_path =
hps = load_or_download_config(language, use_hf=use_hf, config_path=config_path)
Expand Down