-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Malformed JSON Error with codegemma-7b and Hugging Face TGI in VS Code #2380
Comments
Also for reference I opened an issue with TGI so that this behavior can be improved out of the box: huggingface/text-generation-inference#2584 |
Hi @sestinj Thank you for the quick fix on the I restarted my TGI server with However, I'm now running into a different problem. While the chat functionality works perfectly with my chat model in I've tried this on both the pre-release and regular release versions of Continue. I also restarted my TGI server with Here are some of the things I've tried:
"tabAutocompleteModel": {
"title": "CodeGemma Code Completion",
"provider": "huggingface-tgi",
"model": "codegemma-7b",
"apiBase": "http://ip_address",
"completionOptions": {
"stop": [
"<|fim_prefix|>",
"<|fim_suffix|>",
"<|fim_middle|>",
"<|file_separator|>",
"<end_of_turn>",
"<eos>"
]
}
},
"allowAnonymousTelemetry": false,
"tabAutocompleteOptions": {
"multilineCompletions": "never",
"template": "You are a helpful assistant.<|fim_prefix|>{{{ prefix }}}<|fim_suffix|>{{{ suffix }}}<|fim_middle|>"
}, This resulted in the same Here's a snippet from the TGI server logs:
Could this be related to how Continue is handling the response from TGI, or perhaps something specific to the Any further suggestions you have would be greatly appreciated! |
@sestinj , I switched to using Thanks for all your hard work! You have a great product/project! |
Before submitting your bug report
Relevant environment info
Description
I am encountering a persistent
Malformed JSON sent from server: {"error":"Input validation error: `stop` supports up to 4 stop sequences. Given: 16","error_type":"validation"}
error when using the
codegemma-7b
model for tab autocompletion with the Hugging Face TGI provider in VS Code. The error message indicates an issue with thestop
parameter exceeding the allowed number of stop sequences, despite various attempts to configure it correctly.Additional context
codegemma-7b
for autocompletion andcodegemma-7b-it
for chat) are running through Hugging Face TGI on port 80.codegemma-7b-it
works without any issues.codegemma-7b
.Possible issue
While it's most likely user error, it appears that Continue might not be correctly handling the stop sequences defined in the
codegemmaFimTemplate
when thecodegemma
orgemma
template is used. This could lead to Continue sending an incorrect number of stop sequences in the request to the TGI server, causing the "Malformed JSON" error.To reproduce
config.json
:Gradual Adjustments: Made the following incremental changes to the configuration based on troubleshooting suggestions, documentation, and analysis of the
codegemmaFimTemplate
:"template": "codegemma"
(also tried"template": "gemma"
)"maxStopWords": 4
(later changed to 2 and then 1)"completionOptions.stop"
to various combinations, including:["<|fim_prefix|>", "<|fim_suffix|>", "<|fim_middle|>", "<|file_separator|>", "<end_of_turn>", "<eos>"]
["<end_of_turn>", "<eos>"]
["<eos>"]
Error persists: The same "Malformed JSON" error occurred after each configuration change, with the number of given stop sequences varying (e.g., 15 in the initial error message).
Expected behavior
The tab autocompletion should function correctly without any "Malformed JSON" errors.
The text was updated successfully, but these errors were encountered: