Publish pre-built wheels with CUDA support for Linux aarch64. (#1507)

This commit is contained in:
Fangjun Kuang
2024-11-03 19:15:11 +08:00
committed by GitHub
parent c5205f08bf
commit f0cced1f37
2 changed files with 142 additions and 1 deletions

View File

@@ -7,10 +7,28 @@
//
// clang-format off
//
// cd /path/sherpa-onnx/
// mkdir build
// cd build
// cmake ..
// make
//
// wget https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20.tar.bz2
// tar xvf sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20.tar.bz2
// rm sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20.tar.bz2
//
// # 1. Test on CPU, run once
//
// ./bin/streaming-zipformer-rtf-cxx-api
//
// # 2. Test on CPU, run 10 times
//
// ./bin/streaming-zipformer-rtf-cxx-api 10
//
// # 3. Test on GPU, run 10 times
//
// ./bin/streaming-zipformer-rtf-cxx-api 10 cuda
//
// clang-format on
#include <chrono> // NOLINT
@@ -21,13 +39,15 @@
int32_t main(int argc, char *argv[]) {
int32_t num_runs = 1;
if (argc == 2) {
if (argc >= 2) {
num_runs = atoi(argv[1]);
if (num_runs < 0) {
num_runs = 1;
}
}
bool use_gpu = (argc == 3);
using namespace sherpa_onnx::cxx; // NOLINT
OnlineRecognizerConfig config;
@@ -50,6 +70,7 @@ int32_t main(int argc, char *argv[]) {
"./sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20/tokens.txt";
config.model_config.num_threads = 1;
config.model_config.provider = use_gpu ? "cuda" : "cpu";
std::cout << "Loading model\n";
OnlineRecognizer recongizer = OnlineRecognizer::Create(config);