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

Investigate Tab completion reliability #110

Open
fbricon opened this issue Oct 24, 2024 · 10 comments
Open

Investigate Tab completion reliability #110

fbricon opened this issue Oct 24, 2024 · 10 comments
Assignees

Comments

@fbricon
Copy link
Collaborator

fbricon commented Oct 24, 2024

I found that tabCompletion was not reliable with Granite models, eg. I could see some Completion: result being returned from the Continue LLM Prompt/Completion output view, but not proposed as tab completion.

Screenshot 2024-10-24 at 12 02 27

We may need to fine tune tabAutocompleteOptions, see https://docs.continue.dev/customize/deep-dives/autocomplete#configuration-options and/or there might be some integration issue with Granite, in upstream Continue code, that'd need some love.

@adietish
Copy link

adietish commented Nov 6, 2024

I can confirm this is several ways:

  • I dont get (inline) suggestions nor autocompletions at all.
  • At times, there are no (model-)queries in the log.

When model queries happen there's no suggestion in the editor

There are instructions for the case where you dont have these: https://docs.continue.dev/customize/deep-dives/autocomplete#im-not-seeing-any-completions
It didnt help for me.

@adietish
Copy link

adietish commented Nov 7, 2024

I now have code suggestions coming up when using granite-code:3b. Turns out that it strongly depends on where I am at in the editor and what I do:
they come up if I start a new line (hit Return) at a certain position in my code, they then dont come up in the next line.
Image

@adietish adietish self-assigned this Nov 11, 2024
@adietish adietish moved this to In progress in Granite.Code Nov 11, 2024
@jamescho72
Copy link

Please try again with
granite-dense:2b
or
granite-moe:3b

The tags fp16 is also faster response and may help.

@adietish
Copy link

Hi @jamescho72
I tried it with granite-dense:2b. Autocompletes are still as unreliable. The model is much faster though.

@adietish
Copy link

adietish commented Nov 26, 2024

Afaics the majority of cases where no suggestions are shown are caused by suggestion filtering in continue. I stumbled upon other cases, too but couldn't replicate them though. More digging is needed.

A suggestion returned by the model is ignored if it is repeating previous or following lines:

    if (lineIsRepeated(nextLine, trimmedLine)) {
      fullStop();
      break;
    }
    if (line === previousLine) {
      repeatCount++;
      if (repeatCount === MAX_REPEATS) {
        fullStop();
        return;
      }
Screen.Recording.2024-11-25.at.15.58.14.mov

@deboer-tim
Copy link

Fred and I aren't able to get consistent results out of 2b either, I would use granite3-dense:8b for tab completion.

@adietish
Copy link

adietish commented Nov 26, 2024

Fred and I aren't able to get consistent results out of 2b either, I would use granite3-dense:8b for tab completion.

According to my findings in code, the quality of the model (the suggestion provided by the model to be more precise) has an effect. I'll switch to 8b then.

@adietish
Copy link

adietish commented Nov 28, 2024

I'm currently trying to figure why a suggestion provided by granite isn't displayed:

Steps:

  1. ASSERT: edit the following javascript in an editor:
class Calculator {
  constructor() {
    this.result = 0;
  }

  add(number) {
    this.result += number;
    return this;
  }

  subtract(number) {
    this.result -= number;
    return this;
  }

  multiply(number) {
    this.result *= number;
    return this;
  }

  divide(number) {
    if (number === 0) {
      throw new Error("Cannot divide by zero");
    }
    this.result /= number;
    return this;
  }

  getResult() {
    return this.result;
  }

  reset() {
    this.result = 0;
    return this;
  }
}
  1. EXEC: insert a new line after divide(number) {
  2. ASSERT: the following is suggested in the new line: this.result /= number
  3. EXEC: start typing thr

Result:

Screen.Recording.2024-11-28.at.15.43.09.mov

The suggestion disappears as soon as you hit r. If you have a breakpoint at the end of the methodBaseLLM#streamComplete you'll see the model suggesting:

throw new Error("Cannot divide by zero");

But this suggestion isn't displayed. It's cached though and if you get back to the prior line the suggestion is displayed there.

@adietish
Copy link

adietish commented Dec 2, 2024

PR continuedev/continue#3128 fixed the problem described at #110 (comment)

@adietish
Copy link

adietish commented Dec 3, 2024

To me, latest main branch behaves quite consistently. I didn't spot major flaws lately:

Screen.Recording.2024-12-03.at.15.22.17.mov

@fbricon fbricon moved this from In progress to Backlog in Granite.Code Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

4 participants