mirror of
https://github.com/modelscope/FunASR
synced 2025-09-15 14:48:36 +08:00
test
This commit is contained in:
parent
0d32e02c79
commit
ab4a31201c
@ -85,8 +85,12 @@ class DefaultFrontend(nn.Module):
|
|||||||
return self.n_mels
|
return self.n_mels
|
||||||
|
|
||||||
def forward(
|
def forward(
|
||||||
self, input: torch.Tensor, input_lengths: torch.Tensor
|
self, input: torch.Tensor, input_lengths: Union[torch.Tensor, list]
|
||||||
) -> Tuple[torch.Tensor, torch.Tensor]:
|
) -> Tuple[torch.Tensor, torch.Tensor]:
|
||||||
|
if isinstance(input_lengths, list):
|
||||||
|
input_lengths = torch.tensor(input_lengths)
|
||||||
|
if input.dtype == torch.float64:
|
||||||
|
input = input.float()
|
||||||
# 1. Domain-conversion: e.g. Stft: time -> time-freq
|
# 1. Domain-conversion: e.g. Stft: time -> time-freq
|
||||||
if self.stft is not None:
|
if self.stft is not None:
|
||||||
input_stft, feats_lens = self._compute_stft(input, input_lengths)
|
input_stft, feats_lens = self._compute_stft(input, input_lengths)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user