Currently, there are three places where a session builder (and a session from there) are created:
|
ort::session::Session::builder()?.commit_from_memory(buf.as_slice())? |
|
ort::session::Session::builder() |
|
Ok(Session::builder()?.commit_from_file(file)?) |
It would be good to rearrange these actions in the build and runtime sections:
- Set up tracing before state loading
- Currently some ort actions are not visible due to late tracing setup (it will also help our own tracing)
- Create a common builder for all necessary sessions
- We will likely want to use the same options for all sessions we create, and it'll be good to have those options in a single place
- Create/access a session where needed from the existing builder
Currently, there are three places where a session builder (and a session from there) are created:
encoderfile/encoderfile/src/runtime/loader.rs
Line 40 in af055cd
encoderfile/encoderfile/src/dev_utils/mod.rs
Line 66 in af055cd
encoderfile/encoderfile/src/builder/model.rs
Line 79 in af055cd
It would be good to rearrange these actions in the build and runtime sections: