Skip to content

Commit

Permalink
cancel check and ut
Browse files Browse the repository at this point in the history
  • Loading branch information
RandyShuai committed Oct 2, 2023
1 parent 264a740 commit 1c046dd
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
8 changes: 0 additions & 8 deletions onnxruntime/python/onnxruntime_inference_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,14 +446,6 @@ def _create_inference_session(self, providers, provider_options, disabled_optimi
providers, provider_options = check_and_normalize_provider_args(
providers, provider_options, available_providers
)
if not providers and len(available_providers) > 1:
self.disable_fallback()
raise ValueError(
f"This ORT build has {available_providers} enabled. "
"Since ORT 1.9, you are required to explicitly set "
"the providers parameter when instantiating InferenceSession. For example, "
f"onnxruntime.InferenceSession(..., providers={available_providers}, ...)"
)

session_options = self._sess_options if self._sess_options else C.get_default_session_options()
if self._model_path:
Expand Down
6 changes: 1 addition & 5 deletions onnxruntime/test/python/onnxruntime_test_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,7 @@ def test_model_serialization(self):
so.log_severity_level = 1
so.logid = "TestModelSerialization"
so.optimized_model_filepath = "./PythonApiTestOptimizedModel.onnx"
onnxrt.InferenceSession(
get_name("mul_1.onnx"),
sess_options=so,
providers=["CPUExecutionProvider"],
)
onnxrt.InferenceSession(get_name("mul_1.onnx"), sess_options=so)
self.assertTrue(os.path.isfile(so.optimized_model_filepath))
os.remove(so.optimized_model_filepath)
except Fail as onnxruntime_error:
Expand Down

0 comments on commit 1c046dd

Please sign in to comment.