INNER CODE UNIT · Rust
run
nogibjj/rust-mlops-template · OnnxDemo/src/lib.rs:13
pub fn run() -> Result<(), Error> {
// Setup the example's log level.
// NOTE: ONNX Runtime's log level is controlled separately when building the environment.
let subscriber = FmtSubscriber::builder()
.with_max_level(Level::TRACE)
.finish();
tracing::subscriber::set_global_default(subscriber).expect("setting default subscriber failed");
let environment = Environment::builder()
.with_name("test")
// The ONNX Runtime's log level can be different than the one of the wrapper crate or the application.
.with_log_level(LoggingLevel::Info)
.build()?;
let mut session = environment
.new_session_builder()?
.with_optimization_level(GraphOptimizationLevel::Basic)?