compute_wer.sh 925 B

1234567891011121314151617181920212223242526272829303132
  1. wav_dir=$1
  2. wav_files=$(ls $wav_dir/*.wav)
  3. # if wav_files is empty, then exit
  4. if [ -z "$wav_files" ]; then
  5. exit 1
  6. fi
  7. split_name=$2
  8. model_path=models/sherpa-onnx-paraformer-zh-2023-09-14
  9. if [ ! -d $model_path ]; then
  10. pip install sherpa-onnx
  11. wget -nc https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-paraformer-zh-2023-09-14.tar.bz2
  12. tar xvf sherpa-onnx-paraformer-zh-2023-09-14.tar.bz2 -C models
  13. fi
  14. python3 scripts/offline-decode-files.py \
  15. --tokens=$model_path/tokens.txt \
  16. --paraformer=$model_path/model.int8.onnx \
  17. --num-threads=2 \
  18. --decoding-method=greedy_search \
  19. --debug=false \
  20. --sample-rate=24000 \
  21. --log-dir $wav_dir \
  22. --feature-dim=80 \
  23. --split-name $split_name \
  24. --name sherpa_onnx \
  25. $wav_files
  26. # python3 scripts/paraformer-pytriton-client.py \
  27. # --log-dir $wav_dir \
  28. # --split-name $split_name \
  29. # $wav_files