修复报错 TypeError:'type' object is not subscriptable. (#1087)

This commit is contained in:
ChasonJiang 2024-05-19 16:40:13 +08:00 committed by GitHub
parent 35e755427d
commit 2cafde159c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -9,7 +9,7 @@ now_dir = os.getcwd()
sys.path.append(now_dir) sys.path.append(now_dir)
import ffmpeg import ffmpeg
import os import os
from typing import Generator, List, Union from typing import Generator, List, Tuple, Union
import numpy as np import numpy as np
import torch import torch
import torch.nn.functional as F import torch.nn.functional as F
@ -591,7 +591,7 @@ class TTS:
"repetition_penalty": 1.35 # float. repetition penalty for T2S model. "repetition_penalty": 1.35 # float. repetition penalty for T2S model.
} }
returns: returns:
tuple[int, np.ndarray]: sampling rate and audio data. Tuple[int, np.ndarray]: sampling rate and audio data.
""" """
########## variables initialization ########### ########## variables initialization ###########
self.stop_flag:bool = False self.stop_flag:bool = False
@ -874,7 +874,7 @@ class TTS:
speed_factor:float=1.0, speed_factor:float=1.0,
split_bucket:bool=True, split_bucket:bool=True,
fragment_interval:float=0.3 fragment_interval:float=0.3
)->tuple[int, np.ndarray]: )->Tuple[int, np.ndarray]:
zero_wav = torch.zeros( zero_wav = torch.zeros(
int(self.configs.sampling_rate * fragment_interval), int(self.configs.sampling_rate * fragment_interval),
dtype=self.precision, dtype=self.precision,