Render chat template tojson filter as unicode (#31041)
* Render chat template tojson filter as unicode * ruff--
This commit is contained in:
parent
4f98b14465
commit
22dab246c5
|
@ -1853,6 +1853,7 @@ class PreTrainedTokenizerBase(SpecialTokensMixin, PushToHubMixin):
|
|||
raise TemplateError(message)
|
||||
|
||||
jinja_env = ImmutableSandboxedEnvironment(trim_blocks=True, lstrip_blocks=True)
|
||||
jinja_env.policies["json.dumps_kwargs"]["ensure_ascii"] = False
|
||||
jinja_env.globals["raise_exception"] = raise_exception
|
||||
return jinja_env.from_string(chat_template)
|
||||
|
||||
|
|
Loading…
Reference in New Issue