mirror of
https://github.com/RVC-Boss/GPT-SoVITS.git
synced 2025-10-09 00:10:00 +08:00
在其他推理部分加载torch_musa
This commit is contained in:
parent
158f85c745
commit
f7d3d32cf0
@ -7,6 +7,10 @@ sys.path.append(now_dir)
|
|||||||
from typing import Dict
|
from typing import Dict
|
||||||
|
|
||||||
import torch
|
import torch
|
||||||
|
try:
|
||||||
|
import torch_musa
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
from pytorch_lightning import LightningModule
|
from pytorch_lightning import LightningModule
|
||||||
from AR.models.t2s_model import Text2SemanticDecoder
|
from AR.models.t2s_model import Text2SemanticDecoder
|
||||||
from AR.modules.lr_schedulers import WarmupCosineLRSchedule
|
from AR.modules.lr_schedulers import WarmupCosineLRSchedule
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
# modified from https://github.com/yangdongchao/SoundStorm/blob/master/soundstorm/s1/AR/models/t2s_model.py
|
# modified from https://github.com/yangdongchao/SoundStorm/blob/master/soundstorm/s1/AR/models/t2s_model.py
|
||||||
# reference: https://github.com/lifeiteng/vall-e
|
# reference: https://github.com/lifeiteng/vall-e
|
||||||
import torch
|
import torch
|
||||||
|
try:
|
||||||
|
import torch_musa
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
from tqdm import tqdm
|
from tqdm import tqdm
|
||||||
|
|
||||||
from AR.models.utils import make_pad_mask
|
from AR.models.utils import make_pad_mask
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
# modified from https://github.com/yangdongchao/SoundStorm/blob/master/soundstorm/s1/AR/models/utils.py
|
# modified from https://github.com/yangdongchao/SoundStorm/blob/master/soundstorm/s1/AR/models/utils.py
|
||||||
# reference: https://github.com/lifeiteng/vall-e
|
# reference: https://github.com/lifeiteng/vall-e
|
||||||
import torch
|
import torch
|
||||||
|
try:
|
||||||
|
import torch_musa
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
import torch.nn.functional as F
|
import torch.nn.functional as F
|
||||||
from typing import Tuple
|
from typing import Tuple
|
||||||
|
|
||||||
|
@ -2,6 +2,10 @@
|
|||||||
from typing import Optional
|
from typing import Optional
|
||||||
from typing import Tuple
|
from typing import Tuple
|
||||||
import torch
|
import torch
|
||||||
|
try:
|
||||||
|
import torch_musa
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
from torch import Tensor
|
from torch import Tensor
|
||||||
from torch.nn import Linear
|
from torch.nn import Linear
|
||||||
from torch.nn import Module
|
from torch.nn import Module
|
||||||
|
@ -2,6 +2,10 @@
|
|||||||
import math
|
import math
|
||||||
|
|
||||||
import torch
|
import torch
|
||||||
|
try:
|
||||||
|
import torch_musa
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
from torch import nn
|
from torch import nn
|
||||||
|
|
||||||
|
|
||||||
|
@ -7,6 +7,10 @@ from torch.nn.functional import (
|
|||||||
)
|
)
|
||||||
from torch.nn import functional as F
|
from torch.nn import functional as F
|
||||||
import torch
|
import torch
|
||||||
|
try:
|
||||||
|
import torch_musa
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
# Tensor = torch.Tensor
|
# Tensor = torch.Tensor
|
||||||
# from typing import Callable, List, Optional, Tuple, Union
|
# from typing import Callable, List, Optional, Tuple, Union
|
||||||
|
|
||||||
|
@ -21,6 +21,10 @@ from typing import Tuple
|
|||||||
from typing import Union
|
from typing import Union
|
||||||
|
|
||||||
import torch
|
import torch
|
||||||
|
try:
|
||||||
|
import torch_musa
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
import torch.nn as nn
|
import torch.nn as nn
|
||||||
from torch import Tensor
|
from torch import Tensor
|
||||||
|
|
||||||
|
@ -10,6 +10,10 @@ from typing import Tuple
|
|||||||
from typing import Union
|
from typing import Union
|
||||||
|
|
||||||
import torch
|
import torch
|
||||||
|
try:
|
||||||
|
import torch_musa
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
from AR.modules.activation import MultiheadAttention
|
from AR.modules.activation import MultiheadAttention
|
||||||
from AR.modules.scaling import BalancedDoubleSwish
|
from AR.modules.scaling import BalancedDoubleSwish
|
||||||
from torch import nn
|
from torch import nn
|
||||||
|
@ -2,6 +2,10 @@ import time
|
|||||||
|
|
||||||
import librosa
|
import librosa
|
||||||
import torch
|
import torch
|
||||||
|
try:
|
||||||
|
import torch_musa
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
import torch.nn.functional as F
|
import torch.nn.functional as F
|
||||||
import soundfile as sf
|
import soundfile as sf
|
||||||
import logging
|
import logging
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
import math
|
import math
|
||||||
import torch
|
import torch
|
||||||
|
try:
|
||||||
|
import torch_musa
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
from torch import nn
|
from torch import nn
|
||||||
from torch.nn import functional as F
|
from torch.nn import functional as F
|
||||||
|
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
import math
|
import math
|
||||||
import torch
|
import torch
|
||||||
|
try:
|
||||||
|
import torch_musa
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
from torch.nn import functional as F
|
from torch.nn import functional as F
|
||||||
|
|
||||||
|
|
||||||
|
@ -34,6 +34,10 @@ import typing as tp
|
|||||||
|
|
||||||
from einops import rearrange, repeat
|
from einops import rearrange, repeat
|
||||||
import torch
|
import torch
|
||||||
|
try:
|
||||||
|
import torch_musa
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
from torch import nn
|
from torch import nn
|
||||||
import torch.nn.functional as F
|
import torch.nn.functional as F
|
||||||
from tqdm import tqdm
|
from tqdm import tqdm
|
||||||
|
@ -2,6 +2,10 @@ import math
|
|||||||
import os
|
import os
|
||||||
import random
|
import random
|
||||||
import torch
|
import torch
|
||||||
|
try:
|
||||||
|
import torch_musa
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
from torch import nn
|
from torch import nn
|
||||||
import torch.nn.functional as F
|
import torch.nn.functional as F
|
||||||
import torch.utils.data
|
import torch.utils.data
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
import copy
|
import copy
|
||||||
import math
|
import math
|
||||||
import torch
|
import torch
|
||||||
|
try:
|
||||||
|
import torch_musa
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
from torch import nn
|
from torch import nn
|
||||||
from torch.nn import functional as F
|
from torch.nn import functional as F
|
||||||
|
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
import math
|
import math
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import torch
|
import torch
|
||||||
|
try:
|
||||||
|
import torch_musa
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
from torch import nn
|
from torch import nn
|
||||||
from torch.nn import functional as F
|
from torch.nn import functional as F
|
||||||
|
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
# This is Multi-reference timbre encoder
|
# This is Multi-reference timbre encoder
|
||||||
|
|
||||||
import torch
|
import torch
|
||||||
|
try:
|
||||||
|
import torch_musa
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
from torch import nn
|
from torch import nn
|
||||||
from torch.nn.utils import remove_weight_norm, weight_norm
|
from torch.nn.utils import remove_weight_norm, weight_norm
|
||||||
from module.attentions import MultiHeadAttention
|
from module.attentions import MultiHeadAttention
|
||||||
|
@ -11,6 +11,10 @@ import math
|
|||||||
import typing as tp
|
import typing as tp
|
||||||
|
|
||||||
import torch
|
import torch
|
||||||
|
try:
|
||||||
|
import torch_musa
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
from torch import nn
|
from torch import nn
|
||||||
|
|
||||||
from module.core_vq import ResidualVectorQuantization
|
from module.core_vq import ResidualVectorQuantization
|
||||||
|
@ -1,4 +1,8 @@
|
|||||||
import torch
|
import torch
|
||||||
|
try:
|
||||||
|
import torch_musa
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
from torch.nn import functional as F
|
from torch.nn import functional as F
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
Loading…
x
Reference in New Issue
Block a user