icefall/icefall/rnn_lm/export.sh
Fangjun Kuang 2767b9ff11
Support exporting RNNLM to ONNX. (#1014)
* Support exporting RNNLM to ONNX.

* add int8 models

* fix style issues

* Fix EOS padding

* support exporting for streaming ASR
2023-04-27 14:36:36 +08:00

28 lines
662 B
Bash
Executable File

#!/usr/bin/env bash
# We use the model from
# https://huggingface.co/ezerhouni/icefall-librispeech-rnn-lm/tree/main
# as an example
export CUDA_VISIBLE_DEVICES=
if [ ! -f ./icefall-librispeech-rnn-lm/exp/pretrained.pt ]; then
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/ezerhouni/icefall-librispeech-rnn-lm
pushd icefall-librispeech-rnn-lm/exp
git lfs pull --include "pretrained.pt"
ln -s pretrained.pt epoch-99.pt
popd
fi
python3 ./export.py \
--exp-dir ./icefall-librispeech-rnn-lm/exp \
--epoch 99 \
--avg 1 \
--vocab-size 500 \
--embedding-dim 2048 \
--hidden-dim 2048 \
--num-layers 3 \
--tie-weights 1 \
--jit 1