chore(deps): update onnxruntime-openvino (#7854)

This commit is contained in:
Mert 2024-03-16 00:04:45 -04:00 committed by GitHub
parent a9438a9c2d
commit 3a045b33ca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 43 additions and 63 deletions

View file

@ -1,6 +1,5 @@
from __future__ import annotations
import os
from abc import ABC, abstractmethod
from pathlib import Path
from shutil import rmtree
@ -115,17 +114,12 @@ class InferenceModel(ABC):
case ".armnn":
session = AnnSession(model_path)
case ".onnx":
cwd = os.getcwd()
try:
os.chdir(model_path.parent)
session = ort.InferenceSession(
model_path.as_posix(),
sess_options=self.sess_options,
providers=self.providers,
provider_options=self.provider_options,
)
finally:
os.chdir(cwd)
session = ort.InferenceSession(
model_path.as_posix(),
sess_options=self.sess_options,
providers=self.providers,
provider_options=self.provider_options,
)
case _:
raise ValueError(f"Unsupported model file type: {model_path.suffix}")
return session