From 7759ab5febbccdeb929c34a5d5dd4b5387bfd83c Mon Sep 17 00:00:00 2001
From: Yuming Zhang <736099538@qq.com>
Date: 星期五, 23 二月 2024 18:28:26 +0800
Subject: [PATCH] fix bug: 模型初始化可传入参数disable_pbar=True (#1387)

---
 funasr/frontends/wav_frontend.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/funasr/frontends/wav_frontend.py b/funasr/frontends/wav_frontend.py
index f410085..c6e03e8 100644
--- a/funasr/frontends/wav_frontend.py
+++ b/funasr/frontends/wav_frontend.py
@@ -399,11 +399,11 @@
         return feats_pad, feats_lens, lfr_splice_frame_idxs
 
     def forward(
-        self, input: torch.Tensor, input_lengths: torch.Tensor, cache: dict = {}, **kwargs
+        self, input: torch.Tensor, input_lengths: torch.Tensor, **kwargs
     ):
         is_final = kwargs.get("is_final", False)
-        reset = kwargs.get("reset", False)
-        if len(cache) == 0 or reset:
+        cache = kwargs.get("cache", {})
+        if len(cache) == 0:
             self.init_cache(cache)
         
         batch_size = input.shape[0]

--
Gitblit v1.9.1