正在显示
1 个修改的文件
包含
35 行增加
和
0 行删除
| @@ -4,3 +4,38 @@ See <https://github.com/k2-fsa/sherpa> | @@ -4,3 +4,38 @@ See <https://github.com/k2-fsa/sherpa> | ||
| 4 | 4 | ||
| 5 | This repo uses [onnxruntime](https://github.com/microsoft/onnxruntime) and | 5 | This repo uses [onnxruntime](https://github.com/microsoft/onnxruntime) and |
| 6 | does not depend on libtorch. | 6 | does not depend on libtorch. |
| 7 | + | ||
| 8 | + | ||
| 9 | +# Onnxruntime Installation | ||
| 10 | +``` | ||
| 11 | +git clone --recursive --branch v1.12.1 https://github.com/Microsoft/onnxruntime | ||
| 12 | +cd onnxruntime | ||
| 13 | +./build.sh \ | ||
| 14 | + --config RelWithDebInfo \ | ||
| 15 | + --build_shared_lib \ | ||
| 16 | + --build_wheel \ | ||
| 17 | + --skip_tests \ | ||
| 18 | + --parallel 16 | ||
| 19 | +cd build/Linux/RelWithDebInfo | ||
| 20 | +sudo make install | ||
| 21 | +export LD_LIBRARY_PATH=/path/to/onnxruntime/build/Linux/RelWithDebInfo:$LD_LIBRARY_PATH | ||
| 22 | +``` | ||
| 23 | + | ||
| 24 | +# Usage | ||
| 25 | +``` | ||
| 26 | +git clone https://github.com/k2-fsa/sherpa-onnx | ||
| 27 | +cd sherpa-onnx | ||
| 28 | +mkdir build | ||
| 29 | +cd build | ||
| 30 | +cmake -DONNXRUNTIME_ROOTDIR=/path/to/onnxruntime \ | ||
| 31 | + -DKALDI_NATIVE_IO_INSTALL_PREFIX=/path/to/kaldi_native_io .. | ||
| 32 | +make | ||
| 33 | +./bin/sherpa-onnx path/to/encoder.onnx \ | ||
| 34 | + path/to/decoder.onnx \ | ||
| 35 | + path/to/joiner.onnx \ | ||
| 36 | + path/to/joiner_encoder_proj.onnx \ | ||
| 37 | + path/to/joiner_decoder_proj.onnx \ | ||
| 38 | + path/to/tokens.txt \ | ||
| 39 | + greedy \ | ||
| 40 | + path/to/audio.wav | ||
| 41 | +``` |
-
请 注册 或 登录 后发表评论