Skip to content
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

Autocompletion uses dummy template with Qwen Coder + Ollama #3353

Open
3 tasks done
AnnoyingTechnology opened this issue Dec 13, 2024 · 4 comments
Open
3 tasks done
Assignees
Labels
area:autocomplete Relates to the auto complete feature ide:vscode Relates specifically to VS Code extension kind:bug Indicates an unexpected problem or unintended behavior priority:medium Indicates medium priority

Comments

@AnnoyingTechnology
Copy link
Contributor

AnnoyingTechnology commented Dec 13, 2024

Before submitting your bug report

Relevant environment info

- OS: MacOS
- Continue version: main
- IDE version: VS Code
- Model: N/A
- config.json:
  "tabAutocompleteModel": {
    "title": "Qwen 2.5 Coder 3B",
    "provider": "ollama",
    "model": "qwen2.5-coder:3b",
    "contextLength": 2048,
    "completionOptions": {
      "temperature": 0.15,
      "topP": 0.6,
      "topK": 10,
      "maxTokens": 256,
      "keepAlive": 14400
    }
  },

Description

When using qwen coder via ollama, a dummy prompt format (madeupFimPromptTemplate) instead of Qwen's proper FIM prompt template.

To reproduce

This doesn't happen with LM Studio as a backend. I was not able to provide a PR.

Log output

No response

@AnnoyingTechnology
Copy link
Contributor Author

This this especially severe, as Qwen Coder is the commended local model, as per the docs of continue.
And this makes it try to talk instead of complete code, or provide absurd suggestions.

@dosubot dosubot bot added area:autocomplete Relates to the auto complete feature ide:vscode Relates specifically to VS Code extension kind:bug Indicates an unexpected problem or unintended behavior labels Dec 13, 2024
@tomasz-stefaniak
Copy link
Collaborator

@AnnoyingTechnology this is confusing but we only use madeUpFimPrompt for logging purposes. @sestinj is opening a PR now to make it more obvious.

That said, let us know If you see this template in Ollama logs specifically (not in Continue logs). That would indicate that there's an issue after all.

@AnnoyingTechnology
Copy link
Contributor Author

AnnoyingTechnology commented Dec 14, 2024

The bug may have got fixed in the meantime, I'm quite confused by the situation.

Using a fork from last week, ollama logs :
time=2024-12-14T11:27:46.024+01:00 level=DEBUG source=routes.go:270 msg="generate request" images=0 prompt="<|im_start|>system\nYou are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>\n<|im_start|>user\n\n// Untitled-1\n<|im_end|>\n<|im_start|>assistant\n"

It's not the <FIM> from the fake prompt that I assumed to be the culrit, but it's a wrong prompt and causes no suggestions are absurd ones.

Using the latest main branch, ollama logs :
time=2024-12-14T11:06:20.140+01:00 level=DEBUG source=routes.go:270 msg="generate request" images=0 prompt="<|fim_prefix|>\n// scratchpad/lambda.js\nconst <|fim_suffix|>\n<|fim_middle|>"

So clearly there was a bug somewhere.

Also, depending on the model loaded, i saw <FIM> being logged by continue or an actual correct prompt syntax.

@Swipe4057
Copy link

Swipe4057 commented Dec 14, 2024

I have a similar issue with VLLM. #3372

@tomasz-stefaniak tomasz-stefaniak added priority:medium Indicates medium priority and removed "needs-triage" labels Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:autocomplete Relates to the auto complete feature ide:vscode Relates specifically to VS Code extension kind:bug Indicates an unexpected problem or unintended behavior priority:medium Indicates medium priority
Projects
None yet
Development

No branches or pull requests

3 participants