Add C++ runtime and Python API for NeMo Canary models (#2352)
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
#include "onnxruntime_cxx_api.h" // NOLINT
|
||||
#include "sherpa-onnx/csrc/file-utils.h"
|
||||
#include "sherpa-onnx/csrc/macros.h"
|
||||
#include "sherpa-onnx/csrc/offline-recognizer-canary-impl.h"
|
||||
#include "sherpa-onnx/csrc/offline-recognizer-ctc-impl.h"
|
||||
#include "sherpa-onnx/csrc/offline-recognizer-fire-red-asr-impl.h"
|
||||
#include "sherpa-onnx/csrc/offline-recognizer-moonshine-impl.h"
|
||||
@@ -66,6 +67,10 @@ std::unique_ptr<OfflineRecognizerImpl> OfflineRecognizerImpl::Create(
|
||||
return std::make_unique<OfflineRecognizerMoonshineImpl>(config);
|
||||
}
|
||||
|
||||
if (!config.model_config.canary.encoder.empty()) {
|
||||
return std::make_unique<OfflineRecognizerCanaryImpl>(config);
|
||||
}
|
||||
|
||||
// TODO(fangjun): Refactor it. We only need to use model type for the
|
||||
// following models:
|
||||
// 1. transducer and nemo_transducer
|
||||
@@ -252,6 +257,10 @@ std::unique_ptr<OfflineRecognizerImpl> OfflineRecognizerImpl::Create(
|
||||
return std::make_unique<OfflineRecognizerMoonshineImpl>(mgr, config);
|
||||
}
|
||||
|
||||
if (!config.model_config.canary.encoder.empty()) {
|
||||
return std::make_unique<OfflineRecognizerCanaryImpl>(mgr, config);
|
||||
}
|
||||
|
||||
// TODO(fangjun): Refactor it. We only need to use model type for the
|
||||
// following models:
|
||||
// 1. transducer and nemo_transducer
|
||||
|
||||
Reference in New Issue
Block a user