From 8c1016ca77d9b35b829c158092de912f6ec10535 Mon Sep 17 00:00:00 2001
From: 游雁 <zhifu.gzf@alibaba-inc.com>
Date: 星期一, 25 三月 2024 11:48:17 +0800
Subject: [PATCH] install requirements automatically
---
funasr/auto/auto_model.py | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/funasr/auto/auto_model.py b/funasr/auto/auto_model.py
index bba44e7..c31308e 100644
--- a/funasr/auto/auto_model.py
+++ b/funasr/auto/auto_model.py
@@ -25,11 +25,10 @@
from funasr.train_utils.set_all_random_seed import set_all_random_seed
from funasr.train_utils.load_pretrained_model import load_pretrained_model
from funasr.utils import export_utils
-try:
- from funasr.models.campplus.utils import sv_chunk, postprocess, distribute_spk
- from funasr.models.campplus.cluster_backend import ClusterBackend
-except:
- print("Notice: If you want to use the speaker diarization, please `pip install hdbscan`")
+
+from funasr.models.campplus.utils import sv_chunk, postprocess, distribute_spk
+from funasr.models.campplus.cluster_backend import ClusterBackend
+
def prepare_data_iterator(data_in, input_len=None, data_type=None, key=None):
@@ -312,7 +311,8 @@
key = res[i]["key"]
vadsegments = res[i]["value"]
input_i = data_list[i]
- speech = load_audio_text_image_video(input_i, fs=kwargs["frontend"].fs, audio_fs=kwargs.get("fs", 16000))
+ fs = kwargs["frontend"].fs if hasattr(kwargs["frontend"], "fs") else 16000
+ speech = load_audio_text_image_video(input_i, fs=fs, audio_fs=kwargs.get("fs", 16000))
speech_lengths = len(speech)
n = len(vadsegments)
data_with_index = [(vadsegments[i], i) for i in range(n)]
--
Gitblit v1.9.1