From 2a66366be4c2715870e4859fd5a5db6e8a9dc00a Mon Sep 17 00:00:00 2001
From: chenmengzheAAA <123789350+chenmengzheAAA@users.noreply.github.com>
Date: 星期四, 14 九月 2023 19:00:17 +0800
Subject: [PATCH] Merge pull request #956 from alibaba-damo-academy/chenmengzheAAA-patch-4
---
funasr/utils/prepare_data.py | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/funasr/utils/prepare_data.py b/funasr/utils/prepare_data.py
index c9615e7..702c7f3 100644
--- a/funasr/utils/prepare_data.py
+++ b/funasr/utils/prepare_data.py
@@ -5,9 +5,9 @@
import kaldiio
import numpy as np
+import soundfile
import torch.distributed as dist
import torchaudio
-import soundfile
def filter_wav_text(data_dir, dataset):
@@ -87,6 +87,7 @@
sample_name, feature_path = line.strip().split()
feature = kaldiio.load_mat(feature_path)
n_frames, feature_dim = feature.shape
+ write_flag = True
if n_frames > 0 and length_min > 0:
write_flag = n_frames >= length_min
if n_frames > 0 and length_max > 0:
--
Gitblit v1.9.1