diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b1218936027..dfa62ed809f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,7 +8,7 @@ ci: exclude: '(.*\.(css|js|svg))|(.*/(snippets|grpc|proto)/.*)$' repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: 'v0.5.0' + rev: 'v0.5.6' hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix, --show-fixes] @@ -22,11 +22,11 @@ repos: - id: trailing-whitespace - id: end-of-file-fixer - repo: https://github.com/pdm-project/pdm - rev: 2.16.1 + rev: 2.17.3 hooks: - id: pdm-lock-check - repo: https://github.com/bufbuild/buf - rev: v1.34.0 + rev: v1.35.1 hooks: - id: buf-format args: [--config=src/bentoml/grpc/buf.yaml, src/bentoml/grpc] diff --git a/src/bentoml/_internal/frameworks/transformers.py b/src/bentoml/_internal/frameworks/transformers.py index fdf6b40acd1..ff68d3696a4 100644 --- a/src/bentoml/_internal/frameworks/transformers.py +++ b/src/bentoml/_internal/frameworks/transformers.py @@ -1074,7 +1074,7 @@ def save_model( assert "impl" in task_definition, "'task_definition' requires 'impl' key." impl = task_definition["impl"] - if type(pipeline_) != impl: + if isinstance(pipeline_, impl): raise BentoMLException( f"Argument 'pipeline' is not an instance of {impl}. It is an instance of {type(pipeline_)}." )