continue
continue copied to clipboard
Using a tab completions template (moustache) encodes special characters to html
Before submitting your bug report
- [X] I believe this is a bug. I'll try to join the Continue Discord for questions
- [X] I'm not able to find an open issue that reports the same bug
- [X] I've seen the troubleshooting guide on the Continue Docs
Relevant environment info
- OS: Arch Linux
- Continue: v0.9.80 (pre-release)
- IDE: VSCode 1.87.0
Description
Defining a template
in tabAutocompleteOptions
will html encode special characters before they're sent to the model.
E.g.: "
becomes "
, '
becomes '
- The model adapts to this and the response is equally useless.
To reproduce
- Define a
template
intabAutocompleteOptions
. E.g. for deepseek-coder:"tabAutocompleteOptions": { "template": "<|fim▁begin|>{{prefix}}<|fim▁hole|>{{suffix}}<|fim▁end|>" },
- Create a new file, make sure autocomplete is turned on.
- Write something containing quotation marks. E.g.:
print("asd")
- Press Return and enter
print
: - View the log of your LLM server. Example from Koboldcpp:
{ "model": "AUTODETECT", "max_tokens": 1024, "temperature": 0, "stop": [ "\n\n", "```", "function", "class", "module", "export" ], "prompt": "<\uff5cfim\u2581begin\uff5c>print("asd")\np<\uff5cfim\u2581hole\uff5c><\uff5cfim\u2581end\uff5c>", "stream": true }
Log output
Notice "
vs \"
in both examples as a replacement for "
.
Log with template:
{
"model": "AUTODETECT",
"max_tokens": 1024,
"temperature": 0,
"stop": [
"\n\n",
"",
"function",
"class",
"module",
"export"
],
"prompt": "<\uff5cfim\u2581begin\uff5c>print("asd")\np<\uff5cfim\u2581hole\uff5c><\uff5cfim\u2581end\uff5c>",
"stream": true
}
Log without template: (this doesn't acutally give me any output because it's the wrong format)
{
"model": "AUTODETECT",
"max_tokens": 1024,
"temperature": 0,
"stop": [
"<fim_prefix>",
"<fim_suffix>",
"<fim_middle>",
"<|endoftext|>",
"\n\n",
"```",
"function",
"class",
"module",
"export"
],
"prompt": "<fim_prefix>// Path: config.json\n// ]\n// }\n// \n// \"slashCommands\": [\n// {\n// \"name\": \"edit\",\n// \"description\": \"Edit selected code\"\n//\n\nprint(\"asd\")\nprint<fim_suffix><fim_middle>",
"stream": true
}
tabAutocompleteModel
config:
"tabAutocompleteModel": {
"title": "asd",
"provider": "openai",
"model": "AUTODETECT",
"apiBase": "http://localhost:5001/v1",
"template": "deepseek",
"apiKey": ""
},