This repository has been archived on 2025-08-26. You can view files and clone it, but cannot push or open issues or pull requests.
Files
enginex-mr_series-sherpa-onnx/sherpa-onnx/csrc/session.h

40 lines
1.2 KiB
C
Raw Normal View History

2023-05-12 15:57:44 +08:00
// sherpa-onnx/csrc/session.h
//
// Copyright (c) 2023 Xiaomi Corporation
#ifndef SHERPA_ONNX_CSRC_SESSION_H_
#define SHERPA_ONNX_CSRC_SESSION_H_
2024-07-16 15:55:02 +08:00
#include <string>
2023-05-12 15:57:44 +08:00
#include "onnxruntime_cxx_api.h" // NOLINT
#include "sherpa-onnx/csrc/offline-lm-config.h"
#include "sherpa-onnx/csrc/online-lm-config.h"
#include "sherpa-onnx/csrc/online-model-config.h"
2023-05-12 15:57:44 +08:00
namespace sherpa_onnx {
Ort::SessionOptions GetSessionOptionsImpl(
int32_t num_threads, const std::string &provider_str,
const ProviderConfig *provider_config = nullptr);
2023-05-12 15:57:44 +08:00
Ort::SessionOptions GetSessionOptions(const OfflineLMConfig &config);
Ort::SessionOptions GetSessionOptions(const OnlineLMConfig &config);
2023-09-17 14:54:38 +08:00
Ort::SessionOptions GetSessionOptions(const OnlineModelConfig &config);
Ort::SessionOptions GetSessionOptions(const OnlineModelConfig &config,
const std::string &model_type);
2024-12-31 12:44:14 +08:00
Ort::SessionOptions GetSessionOptions(int32_t num_threads,
const std::string &provider_str);
template <typename T>
Ort::SessionOptions GetSessionOptions(const T &config) {
return GetSessionOptionsImpl(config.num_threads, config.provider);
}
2023-05-12 15:57:44 +08:00
} // namespace sherpa_onnx
#endif // SHERPA_ONNX_CSRC_SESSION_H_