Merge pull request #47 from idiap/numpy2

build: add numpy2 support
This commit is contained in:
Enno Hermann 2024-06-17 08:48:18 +01:00 committed by GitHub
commit 81ac7abd58
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 7 additions and 7 deletions

View File

@ -382,8 +382,7 @@ class FreeVC(BaseVC):
"""Load pretrained speaker encoder model as mentioned in the paper.""" """Load pretrained speaker encoder model as mentioned in the paper."""
logger.info("Loading pretrained speaker encoder model ...") logger.info("Loading pretrained speaker encoder model ...")
self.enc_spk_ex = SpeakerEncoderEx( self.enc_spk_ex = SpeakerEncoderEx(
"https://github.com/coqui-ai/TTS/releases/download/v0.13.0_models/speaker_encoder.pt", "https://github.com/coqui-ai/TTS/releases/download/v0.13.0_models/speaker_encoder.pt", device=self.device
device=self.device
) )
def init_multispeaker(self, config: Coqpit): def init_multispeaker(self, config: Coqpit):

View File

@ -91,7 +91,7 @@ class UpsampleNetwork(nn.Module):
use_aux_net, use_aux_net,
): ):
super().__init__() super().__init__()
self.total_scale = np.cumproduct(upsample_scales)[-1] self.total_scale = np.cumprod(upsample_scales)[-1]
self.indent = pad * self.total_scale self.indent = pad * self.total_scale
self.use_aux_net = use_aux_net self.use_aux_net = use_aux_net
if use_aux_net: if use_aux_net:
@ -239,7 +239,7 @@ class Wavernn(BaseVocoder):
if self.args.use_upsample_net: if self.args.use_upsample_net:
assert ( assert (
np.cumproduct(self.args.upsample_factors)[-1] == config.audio.hop_length np.cumprod(self.args.upsample_factors)[-1] == config.audio.hop_length
), " [!] upsample scales needs to be equal to hop_length" ), " [!] upsample scales needs to be equal to hop_length"
self.upsample = UpsampleNetwork( self.upsample = UpsampleNetwork(
self.args.feat_dims, self.args.feat_dims,

View File

@ -2,7 +2,7 @@
requires = [ requires = [
"setuptools", "setuptools",
"cython~=0.29.30", "cython~=0.29.30",
"numpy>=1.24.3", "numpy>=2.0.0",
] ]
build-backend = "setuptools.build_meta" build-backend = "setuptools.build_meta"
@ -84,7 +84,7 @@ dev = [
"coverage[toml]", "coverage[toml]",
"nose2", "nose2",
"pre-commit", "pre-commit",
"ruff==0.3.0", "ruff==0.4.9",
"tomli; python_version < '3.11'", "tomli; python_version < '3.11'",
] ]
# Dependencies for building the documentation # Dependencies for building the documentation
@ -169,6 +169,7 @@ lint.extend-select = [
"PLR1711", # useless-return "PLR1711", # useless-return
"PLW", "PLW",
"W291", # trailing-whitespace "W291", # trailing-whitespace
"NPY201", # NumPy 2.0 deprecation
] ]
lint.ignore = [ lint.ignore = [

View File

@ -4,5 +4,5 @@ black==24.2.0
coverage[toml] coverage[toml]
nose2 nose2
pre-commit pre-commit
ruff==0.3.0 ruff==0.4.9
tomli; python_version < '3.11' tomli; python_version < '3.11'