Open-source speech recognition toolkit for training, inference, streaming ASR, VAD, punctuation, speaker diarization pipelines, and OpenAI-compatible/MCP serving.
Python asraudiochineseemotion-recognitionfunasrmcp-servermultilingual-asropenai-compatible-apiparaformerpunctuationpytorchreal-time-asrspeaker-diarizationspeech-recognitionspeech-to-textstreaming-asrtranscriptionvllmvoice-activity-detectionwhisper-alternative
fix error:reference before assignment for write_flag when using kaldi_ark (#904)
Marlowec29e5071bdb0
diff --git a/funasr/utils/prepare_data.py b/funasr/utils/prepare_data.pyindex c9615e78b..702c7f3a0 100644--- a/funasr/utils/prepare_data.py+++ b/funasr/utils/prepare_data.py@@ -5,9 +5,9 @@ from multiprocessing import Poolimport kaldiioimport numpy as np+import soundfileimport torch.distributed as distimport torchaudio-import soundfiledef filter_wav_text(data_dir, dataset):@@ -87,6 +87,7 @@ def calc_shape_core(root_path, args, idx):sample_name, feature_path = line.strip().split()feature = kaldiio.load_mat(feature_path)n_frames, feature_dim = feature.shape+ write_flag = Trueif n_frames > 0 and length_min > 0:write_flag = n_frames >= length_minif n_frames > 0 and length_max > 0: