From 47343b5c2f4e1256f60f46d8da0aa2e5de39b6c7 Mon Sep 17 00:00:00 2001
From: 嘉渊 <wangjiaming.wjm@alibaba-inc.com>
Date: 星期六, 05 八月 2023 17:53:08 +0800
Subject: [PATCH] init repo
---
funasr/models/frontend/wav_frontend.py | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/funasr/models/frontend/wav_frontend.py b/funasr/models/frontend/wav_frontend.py
index 35fab57..acab13b 100644
--- a/funasr/models/frontend/wav_frontend.py
+++ b/funasr/models/frontend/wav_frontend.py
@@ -6,7 +6,6 @@
import torch
import torchaudio.compliance.kaldi as kaldi
from torch.nn.utils.rnn import pad_sequence
-from typeguard import check_argument_types
import funasr.models.frontend.eend_ola_feature as eend_ola_feature
from funasr.models.frontend.abs_frontend import AbsFrontend
@@ -95,7 +94,6 @@
snip_edges: bool = True,
upsacle_samples: bool = True,
):
- assert check_argument_types()
super().__init__()
self.fs = fs
self.window = window
@@ -227,7 +225,6 @@
snip_edges: bool = True,
upsacle_samples: bool = True,
):
- assert check_argument_types()
super().__init__()
self.fs = fs
self.window = window
@@ -395,8 +392,10 @@
return feats_pad, feats_lens, lfr_splice_frame_idxs
def forward(
- self, input: torch.Tensor, input_lengths: torch.Tensor, is_final: bool = False
+ self, input: torch.Tensor, input_lengths: torch.Tensor, is_final: bool = False, reset: bool = False
) -> Tuple[torch.Tensor, torch.Tensor]:
+ if reset:
+ self.cache_reset()
batch_size = input.shape[0]
assert batch_size == 1, 'we support to extract feature online only when the batch size is equal to 1 now'
waveforms, feats, feats_lengths = self.forward_fbank(input, input_lengths) # input shape: B T D
@@ -464,7 +463,6 @@
lfr_m: int = 1,
lfr_n: int = 1,
):
- assert check_argument_types()
super().__init__()
self.fs = fs
self.frame_length = frame_length
@@ -500,4 +498,4 @@
feats_pad = pad_sequence(feats,
batch_first=True,
padding_value=0.0)
- return feats_pad, feats_lens
\ No newline at end of file
+ return feats_pad, feats_lens
--
Gitblit v1.9.1