From 40de1d64079d25cd0040612558318327114e098f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 11 Feb 2026 05:05:07 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- unsloth/models/_utils.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/unsloth/models/_utils.py b/unsloth/models/_utils.py index c5f6508dfd..3b4a351e09 100644 --- a/unsloth/models/_utils.py +++ b/unsloth/models/_utils.py @@ -2734,11 +2734,13 @@ def make_fast_generate_wrapper(original_generate): "Unsloth: Passing text strings to `fast_generate` on AMD " "requires a tokenizer attached to the model." ) - texts = [first_arg] if isinstance(first_arg, str) else list(first_arg) + texts = ( + [first_arg] if isinstance(first_arg, str) else list(first_arg) + ) tokens = tokenizer( texts, - return_tensors="pt", - padding=True, + return_tensors = "pt", + padding = True, ) tokens = tokens.to(model.device) return original_generate(**tokens, **kwargs)