From dcb6f20696403398ff65d8b7fbbb2985507ff0dc Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 31 Aug 2026 19:04:27 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.15.13 → v0.16.5](https://github.com/astral-sh/ruff-pre-commit/compare/v0.15.13...v0.16.5) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1e25505..678d670 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,7 +15,7 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.15.13 + rev: v0.16.5 hooks: # Run the linter. - id: ruff-check From 527c69fec0e657b5c9d15ef372b637762d5c17cc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 31 Aug 2026 19:04:49 +0000 Subject: [PATCH 2/2] [github-actions] pre-commit fixes --- src/tinytools/validate.py | 6 +++--- src/tinytools/vlm/openai.py | 26 +++++++++++++------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/tinytools/validate.py b/src/tinytools/validate.py index 7f4a889..b64d161 100644 --- a/src/tinytools/validate.py +++ b/src/tinytools/validate.py @@ -14,7 +14,7 @@ T = TypeVar("T") -def validate_shape(array: ArrayTensor, shape: tuple[int | None | EllipsisType, ...], arg_name: str = "array") -> None: +def validate_shape(array: ArrayTensor, shape: tuple[int | EllipsisType | None, ...], arg_name: str = "array") -> None: """Validate that an array shape matches a shape specification. Args: @@ -284,10 +284,10 @@ def validate_and_fill_optional_list( def _validate_shape_parts( *, actual_shape: tuple[int, ...], - expected_parts: tuple[int | None | EllipsisType, ...], + expected_parts: tuple[int | EllipsisType | None, ...], offset: int, arg_name: str, - full_expected: tuple[int | None | EllipsisType, ...], + full_expected: tuple[int | EllipsisType | None, ...], ) -> None: if len(actual_shape) != len(expected_parts): msg = ( diff --git a/src/tinytools/vlm/openai.py b/src/tinytools/vlm/openai.py index 3e12638..3cc8a05 100644 --- a/src/tinytools/vlm/openai.py +++ b/src/tinytools/vlm/openai.py @@ -116,11 +116,11 @@ def encode_image(image: ImageType) -> str: async def completion_with_retries( self, messages: list[dict[str, str]], - response_format: type[BaseModel] | None | Omit = omit, + response_format: type[BaseModel] | Omit | None = omit, max_tokens: int = 8192, - temperature: float | None | Omit = omit, - top_p: float | None | Omit = omit, - presence_penalty: float | None | Omit = omit, + temperature: float | Omit | None = omit, + top_p: float | Omit | None = omit, + presence_penalty: float | Omit | None = omit, extra_body: Body | None = None, ) -> dict[str, str] | None: """Completion with retries. @@ -205,9 +205,9 @@ async def single_forward( no_cache: bool | None = None, ignore_cache: bool | None = None, max_tokens: int = 8192, - temperature: float | None | Omit = omit, - top_p: float | None | Omit = omit, - presence_penalty: float | None | Omit = omit, + temperature: float | Omit | None = omit, + top_p: float | Omit | None = omit, + presence_penalty: float | Omit | None = omit, extra_body: Body | None = None, ) -> str: """Make a single forward pass through the VLM/LLM with an optional image, system prompt and response format. @@ -338,9 +338,9 @@ async def async_forward( no_cache: bool = False, ignore_cache: bool | None = None, max_tokens: int = 8192, - temperature: float | None | Omit = omit, - top_p: float | None | Omit = omit, - presence_penalty: float | None | Omit = omit, + temperature: float | Omit | None = omit, + top_p: float | Omit | None = omit, + presence_penalty: float | Omit | None = omit, extra_body: Body | None = None, ) -> list[str | None]: """Make a forward pass through the VLM/LLM with optional images, system prompts and response format. @@ -400,9 +400,9 @@ def forward( no_cache: bool | None = None, ignore_cache: bool | None = None, max_tokens: int = 8192, - temperature: float | None | Omit = omit, - top_p: float | None | Omit = omit, - presence_penalty: float | None | Omit = omit, + temperature: float | Omit | None = omit, + top_p: float | Omit | None = omit, + presence_penalty: float | Omit | None = omit, extra_body: Body | None = None, ) -> list[str | None]: """Make a forward pass through the VLM/LLM with optional images, system prompts and response format.