From 2c2cf59f09e0eb1953c2c7e5c319757477997ef3 Mon Sep 17 00:00:00 2001 From: mertalev <101130780+mertalev@users.noreply.github.com> Date: Fri, 2 Feb 2024 23:01:31 -0500 Subject: [PATCH] fix typing --- machine-learning/app/models/base.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/machine-learning/app/models/base.py b/machine-learning/app/models/base.py index b3eb6a48d4..b0ac8b9b66 100644 --- a/machine-learning/app/models/base.py +++ b/machine-learning/app/models/base.py @@ -12,7 +12,6 @@ from huggingface_hub import snapshot_download from onnx.shape_inference import infer_shapes from onnx.tools.update_model_dims import update_inputs_outputs_dims from typing_extensions import Buffer - import ann.ann from app.models.constants import STATIC_INPUT_PROVIDERS, SUPPORTED_PROVIDERS @@ -146,7 +145,11 @@ class InferenceModel(ABC): # check_model gets called in update_inputs_outputs_dims and doesn't work for large models check_model = onnx.checker.check_model try: - onnx.checker.check_model = lambda _: None + + def check_model_stub(*args: Any, **kwargs: Any) -> None: + pass + + onnx.checker.check_model = check_model_stub updated_model = update_inputs_outputs_dims(inferred, inputs, outputs) finally: onnx.checker.check_model = check_model