From d238a5ab4450aad636bbbc60d67335ca59b3bd9c Mon Sep 17 00:00:00 2001
From: 游雁 <zhifu.gzf@alibaba-inc.com>
Date: 星期二, 30 七月 2024 17:45:13 +0800
Subject: [PATCH] dcos
---
funasr/auto/auto_model.py | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/funasr/auto/auto_model.py b/funasr/auto/auto_model.py
index 75324dc..f735f18 100644
--- a/funasr/auto/auto_model.py
+++ b/funasr/auto/auto_model.py
@@ -114,7 +114,10 @@
try:
from funasr.utils.version_checker import check_for_update
- check_for_update()
+ print(
+ "Check update of funasr, and it would cost few times. You may disable it by set `disable_update=True` in AutoModel"
+ )
+ check_for_update(disable=kwargs.get("disable_update", False))
except:
pass
@@ -264,6 +267,8 @@
def inference(self, input, input_len=None, model=None, kwargs=None, key=None, **cfg):
kwargs = self.kwargs if kwargs is None else kwargs
+ if "cache" in kwargs:
+ kwargs.pop("cache")
deep_update(kwargs, cfg)
model = self.model if model is None else model
model.eval()
@@ -337,7 +342,7 @@
end_vad = time.time()
# FIX(gcf): concat the vad clips for sense vocie model for better aed
- if kwargs.get("merge_vad", False):
+ if cfg.get("merge_vad", False):
for i in range(len(res)):
res[i]["value"] = merge_vad(
res[i]["value"], kwargs.get("merge_length_s", 15) * 1000
--
Gitblit v1.9.1