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
update repo
嘉渊e0347d08f7ee
diff --git a/egs/aishell/conformer/run.sh b/egs/aishell/conformer/run.shindex 8db0d97c9..fa52c6048 100755--- a/egs/aishell/conformer/run.sh+++ b/egs/aishell/conformer/run.sh@@ -20,8 +20,8 @@ token_type=chartype=soundscp=wav.scpspeed_perturb="0.9 1.0 1.1"-stage=3-stop_stage=4+stage=0+stop_stage=5# feature configurationfeats_dim=80@@ -103,10 +103,16 @@ if [ ${stage} -le 2 ] && [ ${stop_stage} -ge 2 ]; thenecho "<unk>" >> ${token_list}fi-# Training Stage+# LM Training Stageworld_size=$gpu_num # run on one machineif [ ${stage} -le 3 ] && [ ${stop_stage} -ge 3 ]; then- echo "stage 3: Training"+ echo "stage 3: LM Training"+fi++# ASR Training Stage+world_size=$gpu_num # run on one machine+if [ ${stage} -le 4 ] && [ ${stop_stage} -ge 4 ]; then+ echo "stage 4: ASR Training"mkdir -p ${exp_dir}/exp/${model_dir}mkdir -p ${exp_dir}/exp/${model_dir}/logINIT_FILE=${exp_dir}/exp/${model_dir}/ddp_init@@ -146,8 +152,8 @@ if [ ${stage} -le 3 ] && [ ${stop_stage} -ge 3 ]; thenfi# Testing Stage-if [ ${stage} -le 4 ] && [ ${stop_stage} -ge 4 ]; then- echo "stage 4: Inference"+if [ ${stage} -le 5 ] && [ ${stop_stage} -ge 5 ]; then+ echo "stage 5: Inference"for dset in ${test_sets}; doasr_exp=${exp_dir}/exp/${model_dir}inference_tag="$(basename "${inference_config}" .yaml)"diff --git a/egs/aishell/data2vec_paraformer_finetune/run.sh b/egs/aishell/data2vec_paraformer_finetune/run.shindex b9d166893..933bd4375 100755--- a/egs/aishell/data2vec_paraformer_finetune/run.sh+++ b/egs/aishell/data2vec_paraformer_finetune/run.sh@@ -20,8 +20,8 @@ token_type=chartype=soundscp=wav.scpspeed_perturb="0.9 1.0 1.1"-stage=3-stop_stage=4+stage=0+stop_stage=5# feature configurationfeats_dim=80@@ -106,11 +106,17 @@ if [ ${stage} -le 2 ] && [ ${stop_stage} -ge 2 ]; thenecho "<unk>" >> ${token_list}fi-# Training Stage+# LM Training Stageworld_size=$gpu_num # run on one machineif [ ${stage} -le 3 ] && [ ${stop_stage} -ge 3 ]; then- echo "stage 3: Training"- python utils/download_model.py --model_name ${model_name} # download pretrained model on ModelScope+ echo "stage 3: LM Training"+fi++# Training Stage+world_size=$gpu_num # run on one machine+if [ ${stage} -le 4 ] && [ ${stop_stage} -ge 4 ]; then+ echo "stage 4: ASR Training"+ python utils/download_model.py --model_name ${model_name} # download pretrained model on ModelScopemkdir -p ${exp_dir}/exp/${model_dir}mkdir -p ${exp_dir}/exp/${model_dir}/logINIT_FILE=${exp_dir}/exp/${model_dir}/ddp_init@@ -150,8 +156,8 @@ if [ ${stage} -le 3 ] && [ ${stop_stage} -ge 3 ]; thenfi# Testing Stage-if [ ${stage} -le 4 ] && [ ${stop_stage} -ge 4 ]; then- echo "stage 4: Inference"+if [ ${stage} -le 5 ] && [ ${stop_stage} -ge 5 ]; then+ echo "stage 5: Inference"for dset in ${test_sets}; doasr_exp=${exp_dir}/exp/${model_dir}inference_tag="$(basename "${inference_config}" .yaml)"diff --git a/egs/aishell/data2vec_transformer_finetune/run.sh b/egs/aishell/data2vec_transformer_finetune/run.shindex 7bbcf9046..fd3edcc84 100755--- a/egs/aishell/data2vec_transformer_finetune/run.sh+++ b/egs/aishell/data2vec_transformer_finetune/run.sh@@ -20,8 +20,8 @@ token_type=chartype=soundscp=wav.scpspeed_perturb="0.9 1.0 1.1"-stage=3-stop_stage=4+stage=0+stop_stage=5# feature configurationfeats_dim=80@@ -106,11 +106,17 @@ if [ ${stage} -le 2 ] && [ ${stop_stage} -ge 2 ]; thenecho "<unk>" >> ${token_list}fi-# Training Stage+# LM Training Stageworld_size=$gpu_num # run on one machineif [ ${stage} -le 3 ] && [ ${stop_stage} -ge 3 ]; then- echo "stage 3: Training"- python utils/download_model.py --model_name ${model_name} # download pretrained model on ModelScope+ echo "stage 3: LM Training"+fi++# Training Stage+world_size=$gpu_num # run on one machine+if [ ${stage} -le 4 ] && [ ${stop_stage} -ge 4 ]; then+ echo "stage 4: ASR Training"+ python utils/download_model.py --model_name ${model_name} # download pretrained model on ModelScopemkdir -p ${exp_dir}/exp/${model_dir}mkdir -p ${exp_dir}/exp/${model_dir}/logINIT_FILE=${exp_dir}/exp/${model_dir}/ddp_init@@ -151,8 +157,8 @@ if [ ${stage} -le 3 ] && [ ${stop_stage} -ge 3 ]; thenfi# Testing Stage-if [ ${stage} -le 4 ] && [ ${stop_stage} -ge 4 ]; then- echo "stage 4: Inference"+if [ ${stage} -le 5 ] && [ ${stop_stage} -ge 5 ]; then+ echo "stage 5: Inference"for dset in ${test_sets}; doasr_exp=${exp_dir}/exp/${model_dir}inference_tag="$(basename "${inference_config}" .yaml)"diff --git a/egs/aishell/paraformer/run.sh b/egs/aishell/paraformer/run.shindex 430da6e6c..5fab00eb6 100755--- a/egs/aishell/paraformer/run.sh+++ b/egs/aishell/paraformer/run.sh@@ -20,8 +20,8 @@ token_type=chartype=soundscp=wav.scpspeed_perturb="0.9 1.0 1.1"-stage=3-stop_stage=4+stage=0+stop_stage=5# feature configurationfeats_dim=80@@ -103,10 +103,16 @@ if [ ${stage} -le 2 ] && [ ${stop_stage} -ge 2 ]; thenecho "<unk>" >> ${token_list}fi-# Training Stage+# LM Training Stageworld_size=$gpu_num # run on one machineif [ ${stage} -le 3 ] && [ ${stop_stage} -ge 3 ]; then- echo "stage 3: Training"+ echo "stage 3: LM Training"+fi++# Training Stage+world_size=$gpu_num # run on one machine+if [ ${stage} -le 4 ] && [ ${stop_stage} -ge 4 ]; then+ echo "stage 4: ASR Training"mkdir -p ${exp_dir}/exp/${model_dir}mkdir -p ${exp_dir}/exp/${model_dir}/logINIT_FILE=${exp_dir}/exp/${model_dir}/ddp_init@@ -146,8 +152,8 @@ if [ ${stage} -le 3 ] && [ ${stop_stage} -ge 3 ]; thenfi# Testing Stage-if [ ${stage} -le 4 ] && [ ${stop_stage} -ge 4 ]; then- echo "stage 4: Inference"+if [ ${stage} -le 5 ] && [ ${stop_stage} -ge 5 ]; then+ echo "stage 5: Inference"for dset in ${test_sets}; doasr_exp=${exp_dir}/exp/${model_dir}inference_tag="$(basename "${inference_config}" .yaml)"diff --git a/egs/aishell/paraformerbert/run.sh b/egs/aishell/paraformerbert/run.shindex a4ad195aa..4db48d2c5 100755--- a/egs/aishell/paraformerbert/run.sh+++ b/egs/aishell/paraformerbert/run.sh@@ -20,8 +20,8 @@ token_type=chartype=soundscp=wav.scpspeed_perturb="0.9 1.0 1.1"-stage=3-stop_stage=4+stage=0+stop_stage=5skip_extract_embed=falsebert_model_name="bert-base-chinese"@@ -107,10 +107,16 @@ if [ ${stage} -le 2 ] && [ ${stop_stage} -ge 2 ]; thenecho "<unk>" >> ${token_list}fi-# Training Stage+# LM Training Stageworld_size=$gpu_num # run on one machineif [ ${stage} -le 3 ] && [ ${stop_stage} -ge 3 ]; then- echo "stage 3: Training"+ echo "stage 3: LM Training"+fi++# Training Stage+world_size=$gpu_num # run on one machine+if [ ${stage} -le 4 ] && [ ${stop_stage} -ge 4 ]; then+ echo "stage 4: ASR Training"if ! "${skip_extract_embed}"; thenecho "extract embeddings..."local/extract_embeds.sh \@@ -158,8 +164,8 @@ if [ ${stage} -le 3 ] && [ ${stop_stage} -ge 3 ]; thenfi# Testing Stage-if [ ${stage} -le 4 ] && [ ${stop_stage} -ge 4 ]; then- echo "stage 4: Inference"+if [ ${stage} -le 5 ] && [ ${stop_stage} -ge 5 ]; then+ echo "stage 5: Inference"for dset in ${test_sets}; doasr_exp=${exp_dir}/exp/${model_dir}inference_tag="$(basename "${inference_config}" .yaml)"@@ -170,7 +176,7 @@ if [ ${stage} -le 4 ] && [ ${stop_stage} -ge 4 ]; thenexit 0fimkdir -p "${_logdir}"- _data="${feats_dir}/${dumpdir}/${dset}"+ _data="${feats_dir}/data/${dset}"key_file=${_data}/${scp}num_scp_file="$(<${key_file} wc -l)"_nj=$([ $inference_nj -le $num_scp_file ] && echo "$inference_nj" || echo "$num_scp_file")@@ -191,6 +197,7 @@ if [ ${stage} -le 4 ] && [ ${stop_stage} -ge 4 ]; then--njob ${njob} \--gpuid_list ${gpuid_list} \--data_path_and_name_and_type "${_data}/${scp},speech,${type}" \+ --cmvn_file ${feats_dir}/data/${train_set}/cmvn/cmvn.mvn \--key_file "${_logdir}"/keys.JOB.scp \--asr_train_config "${asr_exp}"/config.yaml \--asr_model_file "${asr_exp}"/"${inference_asr_model}" \diff --git a/egs/aishell/transformer/run.sh b/egs/aishell/transformer/run.shindex b7ad9cde5..483ac5b21 100755--- a/egs/aishell/transformer/run.sh+++ b/egs/aishell/transformer/run.sh@@ -20,8 +20,8 @@ token_type=chartype=soundscp=wav.scpspeed_perturb="0.9 1.0 1.1"-stage=3-stop_stage=4+stage=0+stop_stage=5# feature configurationfeats_dim=80@@ -103,10 +103,16 @@ if [ ${stage} -le 2 ] && [ ${stop_stage} -ge 2 ]; thenecho "<unk>" >> ${token_list}fi-# Training Stage+# LM Training Stageworld_size=$gpu_num # run on one machineif [ ${stage} -le 3 ] && [ ${stop_stage} -ge 3 ]; then- echo "stage 3: Training"+ echo "stage 3: LM Training"+fi++# Training Stage+world_size=$gpu_num # run on one machine+if [ ${stage} -le 4 ] && [ ${stop_stage} -ge 4 ]; then+ echo "stage 4: ASR Training"mkdir -p ${exp_dir}/exp/${model_dir}mkdir -p ${exp_dir}/exp/${model_dir}/logINIT_FILE=${exp_dir}/exp/${model_dir}/ddp_init@@ -146,8 +152,8 @@ if [ ${stage} -le 3 ] && [ ${stop_stage} -ge 3 ]; thenfi# Testing Stage-if [ ${stage} -le 4 ] && [ ${stop_stage} -ge 4 ]; then- echo "stage 4: Inference"+if [ ${stage} -le 5 ] && [ ${stop_stage} -ge 5 ]; then+ echo "stage 5: Inference"for dset in ${test_sets}; doasr_exp=${exp_dir}/exp/${model_dir}inference_tag="$(basename "${inference_config}" .yaml)"diff --git a/egs/librispeech/conformer/run.sh b/egs/librispeech/conformer/run.shindex cc4029c3b..2e34cbfea 100755--- a/egs/librispeech/conformer/run.sh+++ b/egs/librispeech/conformer/run.sh@@ -21,7 +21,7 @@ type=soundscp=wav.scpspeed_perturb="0.9 1.0 1.1"stage=0-stop_stage=2+stop_stage=5# feature configurationfeats_dim=80@@ -116,10 +116,16 @@ if [ ${stage} -le 2 ] && [ ${stop_stage} -ge 2 ]; thenecho "<unk>" >> ${token_list}fi-# Training Stage+# LM Training Stageworld_size=$gpu_num # run on one machineif [ ${stage} -le 3 ] && [ ${stop_stage} -ge 3 ]; then- echo "stage 3: Training"+ echo "stage 3: LM Training"+fi++# ASR Training Stage+world_size=$gpu_num # run on one machine+if [ ${stage} -le 4 ] && [ ${stop_stage} -ge 4 ]; then+ echo "stage 4: ASR Training"mkdir -p ${exp_dir}/exp/${model_dir}mkdir -p ${exp_dir}/exp/${model_dir}/logINIT_FILE=${exp_dir}/exp/${model_dir}/ddp_init@@ -162,8 +168,8 @@ if [ ${stage} -le 3 ] && [ ${stop_stage} -ge 3 ]; thenfi# Testing Stage-if [ ${stage} -le 4 ] && [ ${stop_stage} -ge 4 ]; then- echo "stage 4: Inference"+if [ ${stage} -le 5 ] && [ ${stop_stage} -ge 5 ]; then+ echo "stage 5: Inference"for dset in ${test_sets}; doasr_exp=${exp_dir}/exp/${model_dir}inference_tag="$(basename "${inference_config}" .yaml)"diff --git a/egs/librispeech_100h/conformer/run.sh b/egs/librispeech_100h/conformer/run.shindex e9808065d..da7a597b8 100755--- a/egs/librispeech_100h/conformer/run.sh+++ b/egs/librispeech_100h/conformer/run.sh@@ -20,8 +20,8 @@ token_type=bpetype=soundscp=wav.scpspeed_perturb="0.9 1.0 1.1"-stage=3-stop_stage=4+stage=0+stop_stage=5# feature configurationfeats_dim=80@@ -111,10 +111,16 @@ if [ ${stage} -le 2 ] && [ ${stop_stage} -ge 2 ]; thenecho "<unk>" >> ${token_list}fi-# Training Stage+# LM Training Stageworld_size=$gpu_num # run on one machineif [ ${stage} -le 3 ] && [ ${stop_stage} -ge 3 ]; then- echo "stage 3: Training"+ echo "stage 3: LM Training"+fi++# ASR Training Stage+world_size=$gpu_num # run on one machine+if [ ${stage} -le 4 ] && [ ${stop_stage} -ge 4; then+ echo "stage 4: ASR Training"mkdir -p ${exp_dir}/exp/${model_dir}mkdir -p ${exp_dir}/exp/${model_dir}/logINIT_FILE=${exp_dir}/exp/${model_dir}/ddp_init@@ -157,8 +163,8 @@ if [ ${stage} -le 3 ] && [ ${stop_stage} -ge 3 ]; thenfi# Testing Stage-if [ ${stage} -le 4 ] && [ ${stop_stage} -ge 4 ]; then- echo "stage 4: Inference"+if [ ${stage} -le 5 ] && [ ${stop_stage} -ge 5 ]; then+ echo "stage 5: Inference"for dset in ${test_sets}; doasr_exp=${exp_dir}/exp/${model_dir}inference_tag="$(basename "${inference_config}" .yaml)"