Update README (#13)

This commit is contained in:
Fangjun Kuang
2022-10-12 11:49:38 +08:00
committed by GitHub
parent 81646e7be3
commit fb28455292

View File

@@ -5,37 +5,42 @@ See <https://github.com/k2-fsa/sherpa>
This repo uses [onnxruntime](https://github.com/microsoft/onnxruntime) and This repo uses [onnxruntime](https://github.com/microsoft/onnxruntime) and
does not depend on libtorch. does not depend on libtorch.
We provide exported models in onnx format and they can be downloaded using
the following links:
- English: <https://huggingface.co/csukuangfj/icefall-asr-librispeech-pruned-transducer-stateless3-2022-05-13>
- Chinese: `TODO`
**NOTE**: We provide only non-streaming models at present.
# Onnxruntime Installation
```
git clone --recursive --branch v1.12.1 https://github.com/Microsoft/onnxruntime
cd onnxruntime
./build.sh \
--config RelWithDebInfo \
--build_shared_lib \
--build_wheel \
--skip_tests \
--parallel 16
cd build/Linux/RelWithDebInfo
sudo make install
export LD_LIBRARY_PATH=/path/to/onnxruntime/build/Linux/RelWithDebInfo:$LD_LIBRARY_PATH
```
# Usage # Usage
```
```bash
git clone https://github.com/k2-fsa/sherpa-onnx git clone https://github.com/k2-fsa/sherpa-onnx
cd sherpa-onnx cd sherpa-onnx
mkdir build mkdir build
cd build cd build
cmake -DONNXRUNTIME_ROOTDIR=/path/to/onnxruntime \ cmake ..
-DKALDI_NATIVE_IO_INSTALL_PREFIX=/path/to/kaldi_native_io .. make -j6
make cd ..
./bin/sherpa-onnx path/to/encoder.onnx \ ```
path/to/decoder.onnx \
path/to/joiner.onnx \ ## Download the pretrained model (English)
path/to/joiner_encoder_proj.onnx \
path/to/joiner_decoder_proj.onnx \ **Caution**: You have to run `git lfs install`. Otherwise, you will be **SAD** later.
path/to/tokens.txt \
greedy \ ```bash
path/to/audio.wav git lfs install
git clone https://huggingface.co/csukuangfj/icefall-asr-librispeech-pruned-transducer-stateless3-2022-05-13
./build/bin/sherpa-onnx \
./icefall-asr-librispeech-pruned-transducer-stateless3-2022-05-13/exp/onnx/encoder.onnx \
./icefall-asr-librispeech-pruned-transducer-stateless3-2022-05-13/exp/onnx/decoder.onnx \
./icefall-asr-librispeech-pruned-transducer-stateless3-2022-05-13/exp/onnx/joiner.onnx \
./icefall-asr-librispeech-pruned-transducer-stateless3-2022-05-13/exp/onnx/joiner_encoder_proj.onnx \
./icefall-asr-librispeech-pruned-transducer-stateless3-2022-05-13/exp/onnx/joiner_decoder_proj.onnx \
./icefall-asr-librispeech-pruned-transducer-stateless3-2022-05-13/data/lang_bpe_500/tokens.txt \
greedy \
./icefall-asr-librispeech-pruned-transducer-stateless3-2022-05-13/test_wavs/1089-134686-0001.wav
``` ```