LM Studio Chat Template Bug

#23
by redwolfjmt - opened

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("", "")

I changed it to this so it would stop choking: replace("%c"|format(0), "")

Sign up or log in to comment