From b32b21d9c8b0ea659711760e7c80fb572d6b7a41 Mon Sep 17 00:00:00 2001
From: zhaomingwork <61895407+zhaomingwork@users.noreply.github.com>
Date: 星期二, 19 三月 2024 16:28:54 +0800
Subject: [PATCH] for h5 missing some result (#1514)
---
funasr/frontends/default.py | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/funasr/frontends/default.py b/funasr/frontends/default.py
index 364c8bb..c4bdbd7 100644
--- a/funasr/frontends/default.py
+++ b/funasr/frontends/default.py
@@ -85,8 +85,12 @@
return self.n_mels
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]:
+ 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
if self.stft is not None:
input_stft, feats_lens = self._compute_stft(input, input_lengths)
--
Gitblit v1.9.1