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

Error generating autocompletion with Qwen2.5-Coder-7B and vllm #2388

Open
3 tasks done
LNTH opened this issue Sep 25, 2024 · 7 comments
Open
3 tasks done

Error generating autocompletion with Qwen2.5-Coder-7B and vllm #2388

LNTH opened this issue Sep 25, 2024 · 7 comments
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 needs-triage Waiting to be triaged priority:medium Indicates medium priority

Comments

@LNTH
Copy link

LNTH commented Sep 25, 2024

Before submitting your bug report

Relevant environment info

- OS: Windows 11
- Continue: v0.9.211 (pre-release)
- IDE: VS-Code
- Model: `Qwen/Qwen2.5-Coder-7B` served with `vllm`
- config.json:
  
  {
    "models": [],
    "tabAutocompleteModel": {
      "title": "Qwen/Qwen2.5-Coder-7B",
      "provider": "vllm",
      "model": "Qwen/Qwen2.5-Coder-7B",
      "apiBase": "http://192.168.1.19:8000/v1",
      "apiKey": "None",
      "completionOptions": {
        "template": "<|fim_prefix|>{{{ prefix }}}<|fim_suffix|>{{{ suffix }}}<|fim_middle|>",
        "stop": ["<|endoftext|>"]
      }
    }
  }

Description

The tabAutoComplete feature is not displaying any suggestions in the VS Code editor.

  • Continue TabAutoComplete is enabled
  • VSCode: Inline Suggestion is enabled

To reproduce

  1. Ensure the vllm server is running. Confirmed by observing the log entry:
    "GET /v1/models HTTP/1.1" 200 OK whenever the config.json is modified.
  2. Type in the VS Code editor to trigger auto-completion.

Expected Behavior

Auto-completion suggestions should appear in the VS Code editor.

Actual Behavior

vllm server received "POST /v1/completions HTTP/1.1" 200 OK but nothing show on VsCode Editor.
VsCode Console displayed Error generating autocompletion: TypeError: Cannot read properties of undefined (reading 'includes')

Additional Observations

After this error occurs, the Continue extension no longer sends POST /v1/completions requests to the vllm server.

Log output

[Extension Host] Error generating autocompletion: TypeError: Cannot read properties of undefined (reading 'includes')
    at c:\Users\MyUser\.vscode\extensions\continue.continue-0.9.211-win32-x64\out\extension.js:102778:87
    at Array.some (<anonymous>)
    at _CompletionProvider.getTabCompletion (c:\Users\MyUser\.vscode\extensions\continue.continue-0.9.211-win32-x64\out\extension.js:102778:61)
    at async _CompletionProvider.provideInlineCompletionItems (c:\Users\MyUser\.vscode\extensions\continue.continue-0.9.211-win32-x64\out\extension.js:102697:27)
    at async ContinueCompletionProvider.provideInlineCompletionItems (c:\Users\MyUser\.vscode\extensions\continue.continue-0.9.211-win32-x64\out\extension.js:517910:27)
    at async Y.provideInlineCompletions (c:\Users\MyUser\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:161:123619)
@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 priority:medium Indicates medium priority labels Sep 25, 2024
@7216
Copy link

7216 commented Sep 25, 2024

Ran into this same issue.

@7216
Copy link

7216 commented Sep 25, 2024

Found a workaround to get some completions.

{
  "models": [
    {
      "title": "Qwen2.5-Coder-7b-Instruct",
      "provider": "vllm",
      "model": "Orion-zhen/Qwen2.5-Coder-7B-Instruct-AWQ",
      "apiBase": "http://10.0.0.10:8000/v1"
    }
  ],
  "tabAutocompleteModel": {
    "title": "Qwen2.5-Coder-7b-Instruct",
    "provider": "openai",
    "apiKey": "None",
    "completionOptions": {
      "stop": [
        "<|endoftext|>",
        "\n"
      ]
    },
    "apiBase": "http://10.0.0.10:8000/v1/",
    "model": "Orion-zhen/Qwen2.5-Coder-7B-Instruct-AWQ"
  },
  "tabAutocompleteOptions": {
    "multilineCompletions": "never",
    "template": "You are a helpful assistant.<|fim_prefix|>{{{ prefix }}}<|fim_suffix|>{{{ suffix }}}<|fim_middle|>"
  },
  "customCommands": [],
  "allowAnonymousTelemetry": false,
  "docs": []
}

Namely the tabAutocompleteOptions template, and the model provider being openai with the completion options stop including the two entries.

@CMobley7
Copy link

CMobley7 commented Oct 1, 2024

Switched from TGI to vLLM containers and ran into Error generating autocompletion: TypeError: Cannot read properties of undefined (reading 'includes') as @LNTH and @7216 did when using autocomplete. Since codegemma is a supported model I only had to change providers to openai. I also ran into Error streaming diff: TypeError: Cannot read properties of undefined (reading 'toLowerCase') when using Cmd/Ctrl + I to generate or fix code, though Cmd/Ctrl + L worked to chat with my code. Again changing providers to openai worked. So, there seems to be a minor problem with the vLLM provider in both autocomplete and code generation that doesn't appear to affect the openai implementation. My final config was:

"models": [
    {
      "title": "CodeGemma Chat",
      "provider": "openai",
      "model": "/models/codegemma-7b-it",
      "apiBase": "http://ip_address/v1/"
    }
  ],
  "tabAutocompleteModel": {
    "title": "CodeGemma Code Completion",
    "provider": "openai",
    "model": "/models/codegemma-7b",
    "apiBase": "http://ip_address/v1/"
  },

@wnanbei
Copy link

wnanbei commented Oct 9, 2024

same issue

1 similar comment
@ishotoli
Copy link

same issue

@Patrick-Erichsen
Copy link
Contributor

Hi all, thanks for the detailed write-ups and +1s. We've had some other problems with autocomplete not working for folks and are planning to focus on bugfixes shortly. Added this one to our list of issues.

@RomneyDa RomneyDa added the needs-triage Waiting to be triaged label Oct 31, 2024
@mapledxf
Copy link

same problem, any update on this?

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 needs-triage Waiting to be triaged priority:medium Indicates medium priority
Projects
None yet
Development

No branches or pull requests

8 participants