From 3c173e6187ea49520b1e946c9d5de66c824f0864 Mon Sep 17 00:00:00 2001
From: 语帆 <yf352572@alibaba-inc.com>
Date: 星期三, 21 二月 2024 17:02:15 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/main' into dev_yf
---
funasr/auto/auto_model.py | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/funasr/auto/auto_model.py b/funasr/auto/auto_model.py
index e5faa2a..60aeb16 100644
--- a/funasr/auto/auto_model.py
+++ b/funasr/auto/auto_model.py
@@ -23,7 +23,7 @@
from funasr.models.campplus.cluster_backend import ClusterBackend
except:
print("If you want to use the speaker diarization, please `pip install hdbscan`")
-
+import pdb
def prepare_data_iterator(data_in, input_len=None, data_type=None, key=None):
"""
@@ -209,13 +209,15 @@
kwargs.update(cfg)
model = self.model if model is None else model
model.eval()
+ pdb.set_trace()
batch_size = kwargs.get("batch_size", 1)
# if kwargs.get("device", "cpu") == "cpu":
# batch_size = 1
key_list, data_list = prepare_data_iterator(input, input_len=input_len, data_type=kwargs.get("data_type", None), key=key)
-
+ pdb.set_trace()
+
speed_stats = {}
asr_result_list = []
num_samples = len(data_list)
@@ -223,20 +225,25 @@
pbar = tqdm(colour="blue", total=num_samples, dynamic_ncols=True) if not disable_pbar else None
time_speech_total = 0.0
time_escape_total = 0.0
+ pdb.set_trace()
for beg_idx in range(0, num_samples, batch_size):
+ pdb.set_trace()
end_idx = min(num_samples, beg_idx + batch_size)
data_batch = data_list[beg_idx:end_idx]
key_batch = key_list[beg_idx:end_idx]
batch = {"data_in": data_batch, "key": key_batch}
+ pdb.set_trace()
if (end_idx - beg_idx) == 1 and kwargs.get("data_type", None) == "fbank": # fbank
batch["data_in"] = data_batch[0]
batch["data_lengths"] = input_len
time1 = time.perf_counter()
with torch.no_grad():
+ pdb.set_trace()
results, meta_data = model.inference(**batch, **kwargs)
time2 = time.perf_counter()
+ pdb.set_trace()
asr_result_list.extend(results)
# batch_data_time = time_per_frame_s * data_batch_i["speech_lengths"].sum().item()
--
Gitblit v1.9.1