carlrobertoh / CodeGPT

JetBrains extension providing access to state-of-the-art LLMs, such as GPT-4, Claude 3, Code Llama, and others, all for free
https://codegpt.ee
Apache License 2.0
975 stars 202 forks source link

fix: Unsupported code completions #499

Closed reneleonhardt closed 4 months ago

reneleonhardt commented 4 months ago

Most Llama models don't support code completions (only Code Llama and Deepseek Coder). This PR fixes the NPE that was produced and adds support for Llama 3.

I guess #495 beginning of empty line is not possible with com.intellij.codeInsight.inline.completion.elements.InlineCompletionGrayTextElement.Presentable#render returning on empty text. But entering tabulators shows no completion either. Any number of spaces shows completions. But when followed by a backspace (some spaces deleted), completions disappear again 😅

carlrobertoh commented 4 months ago

Hmm, if infilling is not supported for Llama 3, then why support it? Can we just disable it?

reneleonhardt commented 4 months ago

Are you sure? 😉 I tried this PR locally and code completions were shown 😅 Please try if it works for you too.

carlrobertoh commented 4 months ago
llama3_autocomplete
carlrobertoh commented 4 months ago

Code completions require a different prompt template

reneleonhardt commented 4 months ago

I added a new InfillPromptTemplate, can you fix it? Otherwise I'll remove it and just leave the NPE fixes.