nagaraj-real / localaipilot-api

API container for Local AI Pilot extension
https://marketplace.visualstudio.com/items?itemName=nr-codetools.localaipilot
MIT License
37 stars 5 forks source link

Not generating code but repeating <|fim_prefix|> and the start of the file #4

Closed KevinLi-py closed 3 months ago

KevinLi-py commented 3 months ago

Issue

When I press shift + alt + w, this extension repeat my code from the beginning of the file with things like <|fim_prefix|> instead of completing the code.

Before completion: Screenshot before triggering completion After completion: Screenshot after triggering completion As you can see in the screenshot, it didn't generate anything useful but repeat my code. I believe this is a issue due to the extension's inability to correctly handle tokens like <|fim_prefix|>

Environment

OS

Windows 11 Enterprise

Vscode

Version: 1.91.0 (user setup) Commit: ea1445cc7016315d0f5728f8e8b12a45dc0a7286 Date: 2024-07-01T18:52:22.949Z Electron: 29.4.0 ElectronBuildId: 9728852 Chromium: 122.0.6261.156 Node.js: 20.9.0 V8: 12.2.281.27-electron.0 OS: Windows_NT x64 10.0.22631

Ollama

ollama version is 0.2.1

Models

Chat Model: gemma:2b Code Model: codegemma:2b

nagaraj-real commented 3 months ago

This could be as a side effect of an existing issue with Ollama - https://github.com/ollama/ollama/issues/4806. Even if these tokens are included as part of stop tokens, the response is not proper in latest version of Ollama. Will suggest using older version of Ollama.