diff --git a/src/environment.rs b/src/environment.rs index eb56862..83c2e8b 100644 --- a/src/environment.rs +++ b/src/environment.rs @@ -293,8 +293,8 @@ extern_system_fn! { ); match severity { - // TODO: https://github.com/VOICEVOX/voicevox_project/issues/24 をやる際に、libonnxruntime側で`WARNING`未満のログを遮断する - ort_sys::OrtLoggingLevel::ORT_LOGGING_LEVEL_VERBOSE | ort_sys::OrtLoggingLevel::ORT_LOGGING_LEVEL_INFO => {} + ort_sys::OrtLoggingLevel::ORT_LOGGING_LEVEL_VERBOSE => tracing::event!(parent: &span, Level::DEBUG, "{message}"), + ort_sys::OrtLoggingLevel::ORT_LOGGING_LEVEL_INFO => tracing::event!(parent: &span, Level::INFO, "{message}"), ort_sys::OrtLoggingLevel::ORT_LOGGING_LEVEL_WARNING => tracing::event!(parent: &span, Level::WARN, "{message}"), ort_sys::OrtLoggingLevel::ORT_LOGGING_LEVEL_ERROR | ort_sys::OrtLoggingLevel::ORT_LOGGING_LEVEL_FATAL => { tracing::event!(parent: &span, Level::ERROR, "{message}"); diff --git a/src/session/builder.rs b/src/session/builder.rs index 458c6ad..55ce22c 100644 --- a/src/session/builder.rs +++ b/src/session/builder.rs @@ -445,6 +445,11 @@ impl SessionBuilder { }; Ok(session) } + + pub fn commit_from_vv_bin(self, bin: &[u8]) -> Result { + ortsys![unsafe AddSessionConfigEntry(self.session_options_ptr.as_ptr(), c"session.decrypt_vv_model".as_ptr(), c"1".as_ptr())]; + self.commit_from_memory(bin) + } } /// ONNX Runtime provides various graph optimizations to improve performance. Graph optimizations are essentially