disable cpu_mem_arena to save on memory until its actually needed

This commit is contained in:
Josh Hawkins 2024-10-20 13:20:42 -05:00
parent 9e37217d85
commit 07c2ec317d

View File

@ -85,8 +85,14 @@ class ONNXModelRunner:
else:
# Use ONNXRuntime
self.type = "ort"
options = ort.SessionOptions()
if device == "CPU":
options.enable_cpu_mem_arena = False
self.ort = ort.InferenceSession(
model_path, providers=providers, provider_options=options
model_path,
sess_options=options,
providers=providers,
provider_options=options,
)
def get_input_names(self) -> list[str]: