pfluo's picture
update export models and scripts (#6)
6eb615a verified
#!/usr/bin/env bash
# Please go to
# https://huggingface.co/pfluo/k2fsa-zipformer-chinese-english-mixed
# to download the pre-trained models
export CUDA_VISIBLE_DEVICES=""
set -ex
dir=./k2fsa-zipformer-chinese-english-mixed
if [ ! -f $dir/exp/epoch-99.pt ]; then
pushd $dir/exp
ln -s pretrained.pt epoch-99.pt
popd
fi
./pruned_transducer_stateless7_streaming/jit_trace_export.py \
--exp-dir $dir/exp \
--bpe-model $dir/data/lang_char_bpe/bpe.model \
--epoch 99 \
--avg 1 \
--use-averaged-model 0 \
\
--decode-chunk-len 32 \
--num-encoder-layers "2,4,3,2,4" \
--feedforward-dims "1024,1024,1536,1536,1024" \
--nhead "8,8,8,8,8" \
--encoder-dims "384,384,384,384,384" \
--attention-dims "192,192,192,192,192" \
--encoder-unmasked-dims "256,256,256,256,256" \
--zipformer-downsampling-factors "1,2,4,8,2" \
--cnn-module-kernels "31,31,31,31,31" \
--decoder-dim 512 \
--joiner-dim 512
exit 0