Chat Template fix.

#1
by redwolfjmt - opened

Disclosure: This is an issue with the original chat template from RecursiveSI which seems to have been carried forward by most forks of the model.


LM Studio 0.4.26 (build 4),
CUDA12 llama.cpp (LM Studio Runtime) v2.65.0
Harmony (win) v0.3.6

This error appears in the chat template:
Failed to parse Jinja template: Unexpected escaped character: x

It has to do with this line:

| replace("\x00", "")

Apparently the reason is that \x is not a recognized command in lm studio, so you'd need to change this.
There are two solutions that I've tried that seem to work

You either remove the line all together, or you can add a literal Null Character.

Old Snippet:

{{- t | replace("\x00", "") | replace("", "") | replace("", "")

Option 1:
{{- t | replace("", "") | replace("", "")

Option 2:
{{- t | replace("�", "") | replace("", "") | replace("", "")

Sign up or log in to comment