continuedev / continue

⏩ Continue is the leading open-source AI code assistant. You can connect any models and any context to build custom autocomplete and chat experiences inside VS Code and JetBrains
https://docs.continue.dev/
Apache License 2.0
19.25k stars 1.66k forks source link

Tab autocompletion contains '<|im_end|>' and '<|endoftext|>' at the end of the proposed completion #2953

Open d4rkc0de opened 1 day ago

d4rkc0de commented 1 day ago

Before submitting your bug report

Relevant environment info

- OS:ubuntu 20.04
- Continue version: v0.8.56
- IDE version: Vscode 1.95.1
- Model: Qwen2.5-Coder-32B-Instruct
- config.json:

{
  "models": [
    {
      "title": "Hugging Face Inference API",
      "provider": "huggingface-inference-api",
      "model": "Qwen2.5-Coder-32B-Instruct",
      "apiKey": "xxxxx",
      "apiBase": "https://api-inference.huggingface.co/models/Qwen/Qwen2.5-Coder-32B-Instruct"
    }
  ],
  "tabAutocompleteModel": {
    "title": "Hugging Face Inference API",
    "provider": "huggingface-inference-api",
    "model": "Qwen2.5-Coder-32B-Instruct",
    "apiKey": "xxxxx",
    "apiBase": "https://api-inference.huggingface.co/models/Qwen/Qwen2.5-Coder-32B-Instruct"
  },
  "embeddingsProvider": {
    "provider": "voyage",
    "model": "voyage-code-2",
    "apiKey": "xxxxx"
  },
  "reranker": {
    "name": "voyage",
    "params": {
      "model": "rerank-1",
      "apiKey": "xxxxx"
    }
  },
  "customCommands": [
    {
      "name": "test",
      "prompt": "{{{ input }}}\n\nWrite a comprehensive set of unit tests for the selected code. It should setup, run tests that check for correctness including important edge cases, and teardown. Ensure that the tests are complete and sophisticated. Give the tests just as chat output, don't edit any file.",
      "description": "Write unit tests for highlighted code"
    },
    {
      "name": "check",
      "description": "Check for mistakes in my code",
      "prompt": "{{{ input }}}\n\nPlease read the highlighted code and check for any mistakes. You should look for the following, and be extremely vigilant:\n- Syntax errors\n- Logic errors\n- Security vulnerabilities\n- Performance issues\n- Anything else that looks wrong\n\nOnce you find an error, please explain it as clearly as possible, but without using extra words. For example, instead of saying 'I think there is a syntax error on line 5', you should say 'Syntax error on line 5'. Give your answer as one bullet point per mistake found."
    },
    {
      "name": "explain",
      "description": "Explain the highlighted code",
      "prompt": "{{{ input }}}\n\nPlease explain the highlighted code in simple terms."
    },
    {
      "name": "readme",
      "description": "Generate a README template",
      "prompt": "Create a README template for a software project. Include sections for:\n- Project Title\n- Description\n- Installation\n- Usage\n- Features\n- Contributing\n- License\n\nProvide placeholder text that can be easily replaced with project-specific information."
    }
  ],
  "contextProviders": [
    {
      "name": "code",
      "params": {}
    },
    {
      "name": "docs",
      "params": {}
    },
    {
      "name": "diff",
      "params": {}
    },
    {
      "name": "terminal",
      "params": {}
    },
    {
      "name": "problems",
      "params": {}
    },
    {
      "name": "folder",
      "params": {}
    },
    {
      "name": "codebase",
      "params": {}
    }
  ],
  "slashCommands": [
    {
      "name": "edit",
      "description": "Edit selected code"
    },
    {
      "name": "comment",
      "description": "Write comments for the selected code"
    },
    {
      "name": "share",
      "description": "Export the current chat session to markdown"
    },
    {
      "name": "cmd",
      "description": "Generate a shell command"
    },
    {
      "name": "commit",
      "description": "Generate a git commit message"
    },
    {
      "name": "onboard",
      "description": "Familiarize yourself with the codebase"
    }
  ]
}

Description

The autocompletion is adding '<|im_end|>' and '<|endoftext|>' at the end of the autocomplete code, like in the below screenshot, to reproduce use the config.json in this issue:

bug_continue_dev

To reproduce

Use the config.json in this issue, then trigger an autocomplete by writing some code.

Log output

No response