From c57cafa1a5e8bd1f943030a699a020974d8a3dec Mon Sep 17 00:00:00 2001 From: markknoffler Date: Thu, 19 Feb 2026 21:15:59 +0530 Subject: [PATCH] fix: resolve fstring token bug --- gemma/gm/text/_sampler.py | 2 +- gemma/research/t5gemma/sampling.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gemma/gm/text/_sampler.py b/gemma/gm/text/_sampler.py index 944671a3..df14eecc 100644 --- a/gemma/gm/text/_sampler.py +++ b/gemma/gm/text/_sampler.py @@ -572,7 +572,7 @@ def _normalize_token(tokenizer, token: str | int) -> int: token_id = tokenizer.encode(token) if len(token_id) != 1: raise ValueError( - 'Invalid token: {token!r}. `stop_token`s and `forbidden_token`s must' + f'Invalid token: {token!r}. `stop_token`s and `forbidden_token`s must' ' map to single token ids in the vocab.' ) (token_id,) = token_id diff --git a/gemma/research/t5gemma/sampling.py b/gemma/research/t5gemma/sampling.py index 84a16ac4..85415f36 100644 --- a/gemma/research/t5gemma/sampling.py +++ b/gemma/research/t5gemma/sampling.py @@ -510,7 +510,7 @@ def _normalize_token(tokenizer, token: str | int) -> int: token_id = tokenizer.encode(token) if len(token_id) != 1: raise ValueError( - 'Invalid forbidden token: {token!r}. Forbidden tokens must map to' + f'Invalid forbidden token: {token!r}. Forbidden tokens must map to' ' single token ids in the vocab.' ) (token_id,) = token_id