Skip to content

Commit e61d692

Browse files
authored
Fix building for Windows (#2964)
1 parent 4ea060a commit e61d692

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

sherpa-onnx/csrc/offline-funasr-nano-model.cc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "sherpa-onnx/csrc/macros.h"
3030
#include "sherpa-onnx/csrc/onnx-utils.h"
3131
#include "sherpa-onnx/csrc/session.h"
32+
#include "sherpa-onnx/csrc/text-utils.h"
3233

3334
namespace sherpa_onnx {
3435

@@ -705,7 +706,7 @@ class OfflineFunASRNanoModel::Impl {
705706
private:
706707
void InitEncoderAdaptor(const std::string &model_path) {
707708
encoder_sess_ = std::make_unique<Ort::Session>(
708-
env_, model_path.c_str(), sess_opts_encoder_);
709+
env_, SHERPA_ONNX_TO_ORT_PATH(model_path), sess_opts_encoder_);
709710
GetInputNames(encoder_sess_.get(), &encoder_input_names_,
710711
&encoder_input_names_ptr_);
711712
GetOutputNames(encoder_sess_.get(), &encoder_output_names_,
@@ -729,7 +730,7 @@ class OfflineFunASRNanoModel::Impl {
729730

730731
void InitLLMPrefill(const std::string &model_path) {
731732
prefill_sess_ = std::make_unique<Ort::Session>(
732-
env_, model_path.c_str(), sess_opts_llm_);
733+
env_, SHERPA_ONNX_TO_ORT_PATH(model_path), sess_opts_llm_);
733734
GetInputNames(prefill_sess_.get(), &prefill_input_names_,
734735
&prefill_input_names_ptr_);
735736
GetOutputNames(prefill_sess_.get(), &prefill_output_names_,
@@ -754,7 +755,7 @@ class OfflineFunASRNanoModel::Impl {
754755

755756
void InitLLMDecode(const std::string &model_path) {
756757
decode_sess_ = std::make_unique<Ort::Session>(
757-
env_, model_path.c_str(), sess_opts_llm_);
758+
env_, SHERPA_ONNX_TO_ORT_PATH(model_path), sess_opts_llm_);
758759
GetInputNames(decode_sess_.get(), &decode_input_names_,
759760
&decode_input_names_ptr_);
760761
GetOutputNames(decode_sess_.get(), &decode_output_names_,
@@ -788,7 +789,7 @@ class OfflineFunASRNanoModel::Impl {
788789

789790
void InitEmbedding(const std::string &model_path) {
790791
embedding_sess_ = std::make_unique<Ort::Session>(
791-
env_, model_path.c_str(), sess_opts_embedding_);
792+
env_, SHERPA_ONNX_TO_ORT_PATH(model_path), sess_opts_embedding_);
792793
GetInputNames(embedding_sess_.get(), &embedding_input_names_,
793794
&embedding_input_names_ptr_);
794795
GetOutputNames(embedding_sess_.get(), &embedding_output_names_,

0 commit comments

Comments
 (0)