Skip to content

Open-source speech recognition toolkit for training, inference, streaming ASR, VAD, punctuation, speaker diarization pipelines, and OpenAI-compatible/MCP serving.

fix vad cpu infer.sh batch=1

游雁c197b3aa85ef
diff --git a/egs_modelscope/vad/TEMPLATE/infer.sh b/egs_modelscope/vad/TEMPLATE/infer.sh
index 7dc03871f..0651c98f8 100644
--- a/egs_modelscope/vad/TEMPLATE/infer.sh
+++ b/egs_modelscope/vad/TEMPLATE/infer.sh
@@ -9,7 +9,7 @@ stop_stage=2
model="damo/speech_fsmn_vad_zh-cn-16k-common"
data_dir="./data/test"
output_dir="./results"
-batch_size=64
+batch_size=1
gpu_inference=true # whether to perform gpu decoding
gpuid_list="0,1" # set gpus, e.g., gpuid_list="0,1"
njob=64 # the number of jobs for CPU decoding, if gpu_inference=false, use CPU decoding, please set njob
diff --git a/funasr/bin/vad_inference.py b/funasr/bin/vad_inference.py
index f9dc39770..5fbd8449a 100644
--- a/funasr/bin/vad_inference.py
+++ b/funasr/bin/vad_inference.py
@@ -274,8 +274,7 @@ def inference_modelscope(
assert check_argument_types()
if batch_size > 1:
raise NotImplementedError("batch decoding is not implemented")
- if ngpu > 1:
- raise NotImplementedError("only single GPU decoding is supported")
+
logging.basicConfig(
level=log_level,
@@ -286,7 +285,7 @@ def inference_modelscope(
device = "cuda"
else:
device = "cpu"
-
+ batch_size = 1
# 1. Set random-seed
set_all_random_seed(seed)
@@ -376,10 +375,7 @@ def inference_modelscope_online(
**kwargs,
):
assert check_argument_types()
- if batch_size > 1:
- raise NotImplementedError("batch decoding is not implemented")
- if ngpu > 1:
- raise NotImplementedError("only single GPU decoding is supported")
+
logging.basicConfig(
level=log_level,
@@ -390,6 +386,7 @@ def inference_modelscope_online(
device = "cuda"
else:
device = "cpu"
+ batch_size = 1
# 1. Set random-seed
set_all_random_seed(seed)
diff --git a/funasr/bin/vad_inference_online.py b/funasr/bin/vad_inference_online.py
index e1dbcf256..a3633093e 100644
--- a/funasr/bin/vad_inference_online.py
+++ b/funasr/bin/vad_inference_online.py
@@ -156,8 +156,6 @@ def inference_modelscope(
if batch_size > 1:
raise NotImplementedError("batch decoding is not implemented")
- if ngpu > 1:
- raise NotImplementedError("only single GPU decoding is supported")
logging.basicConfig(
level=log_level,
@@ -168,7 +166,7 @@ def inference_modelscope(
device = "cuda"
else:
device = "cpu"
-
+ batch_size = 1
# 1. Set random-seed
set_all_random_seed(seed)