[Bugfix] Add missing f-string prefix in xgrammar choices error message (#38162)

Signed-off-by: Yifan Zong <yzong@redhat.com>
This commit is contained in:
yzong-rh
2026-03-26 17:43:03 -04:00
committed by GitHub
parent c32e97602d
commit 28048bd6b0

View File

@@ -289,7 +289,7 @@ def validate_xgrammar_grammar(sampling_params: SamplingParams) -> None:
xgr.Grammar.from_ebnf(choice_grammar)
except Exception as err:
raise ValueError(
"Failed to transform choices into a grammar: {err}"
f"Failed to transform choices into a grammar: {err}"
) from err
so_params.choice = None
so_params.grammar = choice_grammar