fix: funasr_onnx pass run_options to ort (#2632)

This commit is contained in:
Kyle He 2025-08-14 16:07:54 +08:00 committed by GitHub
parent 68dcef510a
commit 82a07e2f6e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -221,10 +221,10 @@ class OrtInferSession:
RuntimeWarning,
)
def __call__(self, input_content: List[Union[np.ndarray, np.ndarray]]) -> np.ndarray:
def __call__(self, input_content: List[Union[np.ndarray, np.ndarray]], run_options = None) -> np.ndarray:
input_dict = dict(zip(self.get_input_names(), input_content))
try:
return self.session.run(self.get_output_names(), input_dict)
return self.session.run(self.get_output_names(), input_dict, run_options)
except Exception as e:
raise ONNXRuntimeError("ONNXRuntime inferece failed.") from e