Skip to content

Commit 22dab24

Browse files
authored
Render chat template tojson filter as unicode (#31041)
* Render chat template tojson filter as unicode * ruff--
1 parent 4f98b14 commit 22dab24

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/transformers/tokenization_utils_base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1853,6 +1853,7 @@ def raise_exception(message):
18531853
raise TemplateError(message)
18541854

18551855
jinja_env = ImmutableSandboxedEnvironment(trim_blocks=True, lstrip_blocks=True)
1856+
jinja_env.policies["json.dumps_kwargs"]["ensure_ascii"] = False
18561857
jinja_env.globals["raise_exception"] = raise_exception
18571858
return jinja_env.from_string(chat_template)
18581859

0 commit comments

Comments
 (0)