mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-31 14:33:54 -04:00
Ensure onnx telemetry is disabled
This commit is contained in:
parent
504d1a4f1d
commit
1a751bc1c2
@ -229,30 +229,11 @@ set_voice(PyObject *self, PyObject *args) {
|
|||||||
// Load onnx model
|
// Load onnx model
|
||||||
Py_BEGIN_ALLOW_THREADS;
|
Py_BEGIN_ALLOW_THREADS;
|
||||||
static Ort::SessionOptions opts;
|
static Ort::SessionOptions opts;
|
||||||
|
|
||||||
// for (const auto& p : available_providers) {
|
|
||||||
// std::unordered_map<std::string, std::string> provider_options;
|
|
||||||
// try {
|
|
||||||
// opts.AppendExecutionProvider(p, provider_options);
|
|
||||||
// } catch (const Ort::Exception& e) {
|
|
||||||
// fprintf(stderr, "Failed to append execution provider: '%s' with error: %s\n", p.c_str(), e.what());
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// OrtDnnlProviderOptions* dnnl_options_ptr = nullptr;
|
|
||||||
// OrtStatus* status = Ort::GetApi().CreateDnnlProviderOptions(&dnnl_options_ptr);
|
|
||||||
// if (status == nullptr) {
|
|
||||||
// printf("11111111111111111 %d\n", __LINE__);
|
|
||||||
// try {
|
|
||||||
// opts.AppendExecutionProvider_Dnnl(*dnnl_options_ptr);
|
|
||||||
// printf("11111111111111111 %d\n", __LINE__);
|
|
||||||
// } catch (const Ort::Exception& e) {
|
|
||||||
// fprintf(stderr, "Failed to append execution provider with error: %s\n", e.what());
|
|
||||||
// }}
|
|
||||||
|
|
||||||
opts.DisableCpuMemArena();
|
opts.DisableCpuMemArena();
|
||||||
opts.DisableMemPattern();
|
opts.DisableMemPattern();
|
||||||
opts.DisableProfiling();
|
opts.DisableProfiling();
|
||||||
Ort::Env ort_env{ORT_LOGGING_LEVEL_WARNING, "piper"};
|
Ort::Env ort_env{ORT_LOGGING_LEVEL_WARNING, "piper"};
|
||||||
|
ort_env.DisableTelemetryEvents();
|
||||||
session.reset();
|
session.reset();
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
wchar_t *model_path = PyUnicode_AsWideCharString(pymp, NULL);
|
wchar_t *model_path = PyUnicode_AsWideCharString(pymp, NULL);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user