Closed 00010110 closed 1 month ago
my Autocomplete config "tabAutocompleteModel": { "title": "qwen2.5", "provider": "ollama", "apiBase": "http://192.168.13.90:11434", "model": "qwen2.5-coder:7b-base " }
Could be: "template": "<|fim_prefix|>{{{ prefix }}}<|fim_suffix|>{{{ suffix }}}<|fim_middle|>",
Referenced from: https://github.com/QwenLM/Qwen2.5-Coder?tab=readme-ov-file#3-file-level-code-completion-fill-in-the-middle
https://arxiv.org/html/2409.12186v1
You can see there that FIM tokens indeed changed compared to codeqwen, so @cbingrui template is correct. Works for me also.
But even more important: you should use -instruct, not -base model. I've not been sure either, but then checked it by manually prompting both models with FIM examples in ollama. Given <|fim_prefix|>Hello<|fim_suffix|>ld!<|fim_middle|>
, base model just starts spewing a lot of code. The same prompt result in actual line from -instruct. It makes sense if you think about it, base model is just that - does not include training with FIM tokens.
I had the same issue, but after following the qwen2.5-coder instructions and making some adjustments, it worked. @cbingrui I'll submit a PR with the fix soon.
That fix isn't quite complete, Qwen 2.5 coder seems to have another stop token still defined: "<|endoftext|>"
This particularly seems to occur around attempts to create strings/comments.
@harrychin
Thank you for catching this! You're right, I missed the <|endoftext|>
stop token at #2341 .
I've also confirmed this in the tokenizer_config.json file on the Hugging Face repo. (https://huggingface.co/Qwen/Qwen2.5-Coder-7B/blob/main/tokenizer_config.json)
I'll create a new PR to fix this shortly. Really appreciate your thorough review and feedback.
EDIT: Will create PR for branch cleanup after updating dev
PR has been merged, thank you @KangmoonSeo !
Before submitting your bug report
Relevant environment info
Description
On the same configuration, with the latest Codestral version and FIM model, it can work normally.
To reproduce
No response
Log output