Yunusemre
Committed by GitHub

Merge pull request #6 from EmreOzkose/master

adding usage and onnxruntime instructions to README
@@ -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 +```
@@ -3,7 +3,7 @@ function(download_kaldi_native_fbank) @@ -3,7 +3,7 @@ function(download_kaldi_native_fbank)
3 # FetchContent is available since 3.11, 3 # FetchContent is available since 3.11,
4 # we've copied it to ${CMAKE_SOURCE_DIR}/cmake/Modules 4 # we've copied it to ${CMAKE_SOURCE_DIR}/cmake/Modules
5 # so that it can be used in lower CMake versions. 5 # so that it can be used in lower CMake versions.
6 - message(STATUS "Use FetchContent provided by sherpa-ncnn") 6 + message(STATUS "Use FetchContent provided by sherpa-onnx")
7 list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules) 7 list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)
8 endif() 8 endif()
9 9