嘉渊
2023-05-16 90d8e42e9e4a732c40216d14936221c445507f30
update repo
8个文件已修改
104 ■■■■■ 已修改文件
egs/aishell2/conformer/run.sh 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
egs/aishell2/data2vec_pretrain/run.sh 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
egs/aishell2/paraformer/run.sh 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
egs/aishell2/paraformerbert/run.sh 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
egs/aishell2/transformer/run.sh 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
funasr/models/e2e_asr_transducer.py 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
funasr/models/e2e_sa_asr.py 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
funasr/tasks/sa_asr.py 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
egs/aishell2/conformer/run.sh
@@ -21,16 +21,16 @@
scp=wav.scp
speed_perturb="0.9 1.0 1.1"
dataset_type=large
stage=3
stop_stage=4
stage=0
stop_stage=5
# feature configuration
feats_dim=80
nj=64
# data
tr_dir=/nfs/wangjiaming.wjm/asr_data/aishell2/AISHELL-2/iOS/data
dev_tst_dir=/nfs/wangjiaming.wjm/asr_data/aishell2/AISHELL-DEV-TEST-SET
tr_dir=
dev_tst_dir=
# exp tag
tag="exp1"
@@ -107,10 +107,16 @@
    mkdir -p ${feats_dir}/asr_stats_fbank_zh_char/${valid_set}
 fi
# Training Stage
# LM Training Stage
world_size=$gpu_num  # run on one machine
if [ ${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}/log
    INIT_FILE=${exp_dir}/exp/${model_dir}/ddp_init
@@ -151,8 +157,8 @@
fi
# 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}; do
        asr_exp=${exp_dir}/exp/${model_dir}
        inference_tag="$(basename "${inference_config}" .yaml)"
egs/aishell2/data2vec_pretrain/run.sh
@@ -24,8 +24,8 @@
nj=64
# data
tr_dir=/nfs/wangjiaming.wjm/asr_data/aishell2/AISHELL-2/iOS/data
dev_tst_dir=/nfs/wangjiaming.wjm/asr_data/aishell2/AISHELL-DEV-TEST-SET
tr_dir=
dev_tst_dir=
# exp tag
tag="exp1"
egs/aishell2/paraformer/run.sh
@@ -21,16 +21,16 @@
scp=wav.scp
speed_perturb="0.9 1.0 1.1"
dataset_type=large
stage=3
stop_stage=4
stage=0
stop_stage=5
# feature configuration
feats_dim=80
nj=64
# data
tr_dir=/nfs/wangjiaming.wjm/asr_data/aishell2/AISHELL-2/iOS/data
dev_tst_dir=/nfs/wangjiaming.wjm/asr_data/aishell2/AISHELL-DEV-TEST-SET
tr_dir=
dev_tst_dir=
# exp tag
tag="exp1"
@@ -105,10 +105,16 @@
    echo "<unk>" >> ${token_list}
 fi
# Training Stage
# LM Training Stage
world_size=$gpu_num  # run on one machine
if [ ${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}/log
    INIT_FILE=${exp_dir}/exp/${model_dir}/ddp_init
@@ -149,8 +155,8 @@
fi
# 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}; do
        asr_exp=${exp_dir}/exp/${model_dir}
        inference_tag="$(basename "${inference_config}" .yaml)"
egs/aishell2/paraformerbert/run.sh
@@ -21,8 +21,8 @@
scp=wav.scp
speed_perturb="0.9 1.0 1.1"
dataset_type=large
stage=3
stop_stage=4
stage=0
stop_stage=5
skip_extract_embed=false
bert_model_name="bert-base-chinese"
@@ -32,8 +32,8 @@
nj=64
# data
tr_dir=/nfs/wangjiaming.wjm/asr_data/aishell2/AISHELL-2/iOS/data
dev_tst_dir=/nfs/wangjiaming.wjm/asr_data/aishell2/AISHELL-DEV-TEST-SET
tr_dir=
dev_tst_dir=
# exp tag
tag="exp1"
@@ -108,10 +108,16 @@
    echo "<unk>" >> ${token_list}
 fi
# Training Stage
# LM Training Stage
world_size=$gpu_num  # run on one machine
if [ ${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"
    if ! "${skip_extract_embed}"; then
        echo "extract embeddings..."
        local/extract_embeds.sh \
@@ -160,8 +166,8 @@
fi
# 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}; do
        asr_exp=${exp_dir}/exp/${model_dir}
        inference_tag="$(basename "${inference_config}" .yaml)"
egs/aishell2/transformer/run.sh
@@ -21,16 +21,16 @@
scp=wav.scp
speed_perturb="0.9 1.0 1.1"
dataset_type=large
stage=3
stop_stage=4
stage=0
stop_stage=5
# feature configuration
feats_dim=80
nj=64
# data
tr_dir=/nfs/wangjiaming.wjm/asr_data/aishell2/AISHELL-2/iOS/data
dev_tst_dir=/nfs/wangjiaming.wjm/asr_data/aishell2/AISHELL-DEV-TEST-SET
tr_dir=
dev_tst_dir=
# exp tag
tag="exp1"
@@ -105,10 +105,16 @@
    echo "<unk>" >> ${token_list}
 fi
# Training Stage
# LM Training Stage
world_size=$gpu_num  # run on one machine
if [ ${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}/log
    INIT_FILE=${exp_dir}/exp/${model_dir}/ddp_init
@@ -149,8 +155,8 @@
fi
# 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}; do
        asr_exp=${exp_dir}/exp/${model_dir}
        inference_tag="$(basename "${inference_config}" .yaml)"
funasr/models/e2e_asr_transducer.py
@@ -17,7 +17,7 @@
from funasr.modules.nets_utils import get_transducer_task_io
from funasr.layers.abs_normalize import AbsNormalize
from funasr.torch_utils.device_funcs import force_gatherable
from funasr.train.abs_espnet_model import AbsESPnetModel
from funasr.models.base_model import FunASRModel
if V(torch.__version__) >= V("1.6.0"):
    from torch.cuda.amp import autocast
@@ -28,7 +28,7 @@
        yield
class TransducerModel(AbsESPnetModel):
class TransducerModel(FunASRModel):
    """ESPnet2ASRTransducerModel module definition.
    Args:
funasr/models/e2e_sa_asr.py
@@ -29,7 +29,7 @@
from funasr.modules.e2e_asr_common import ErrorCalculator
from funasr.modules.nets_utils import th_accuracy
from funasr.torch_utils.device_funcs import force_gatherable
from funasr.train.abs_espnet_model import AbsESPnetModel
from funasr.models.base_model import FunASRModel
if LooseVersion(torch.__version__) >= LooseVersion("1.6.0"):
    from torch.cuda.amp import autocast
@@ -40,7 +40,7 @@
        yield
class ESPnetASRModel(AbsESPnetModel):
class ESPnetASRModel(FunASRModel):
    """CTC-attention hybrid Encoder-Decoder model"""
    def __init__(
funasr/tasks/sa_asr.py
@@ -70,11 +70,11 @@
from funasr.models.specaug.abs_specaug import AbsSpecAug
from funasr.models.specaug.specaug import SpecAug
from funasr.models.specaug.specaug import SpecAugLFR
from funasr.models.base_model import FunASRModel
from funasr.modules.subsampling import Conv1dSubsampling
from funasr.tasks.abs_task import AbsTask
from funasr.text.phoneme_tokenizer import g2p_choices
from funasr.torch_utils.initialize import initialize
from funasr.train.abs_espnet_model import AbsESPnetModel
from funasr.train.class_choices import ClassChoices
from funasr.train.trainer import Trainer
from funasr.utils.get_default_kwargs import get_default_kwargs
@@ -129,7 +129,7 @@
        mfcca=MFCCA,
        timestamp_prediction=TimestampPredictor,
    ),
    type_check=AbsESPnetModel,
    type_check=FunASRModel,
    default="asr",
)
preencoder_choices = ClassChoices(