From bdaa41b9d35835d862d3725ca444dbd521d0ccaf Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 6 Aug 2024 03:01:33 -0400 Subject: [PATCH] ci: pre-commit autoupdate (#4897) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ci: pre-commit autoupdate [skip ci] updates: - [github.com/astral-sh/ruff-pre-commit: v0.5.0 → v0.5.6](https://github.com/astral-sh/ruff-pre-commit/compare/v0.5.0...v0.5.6) - [github.com/pdm-project/pdm: 2.16.1 → 2.17.3](https://github.com/pdm-project/pdm/compare/2.16.1...2.17.3) - [github.com/bufbuild/buf: v1.34.0 → v1.35.1](https://github.com/bufbuild/buf/compare/v1.34.0...v1.35.1) * chore: update check to use isinstance Signed-off-by: Aaron Pham --------- Signed-off-by: Aaron Pham Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Aaron Pham --- .pre-commit-config.yaml | 6 +++--- src/bentoml/_internal/frameworks/transformers.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) 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_)}." )