Skip to content

Trim off <|file_separator|> from autocomplete completion for Google Models #6067

Open
@hayden-cardwell

Description

@hayden-cardwell

Validations

  • I believe this is a way to improve. I'll try to join the Continue Discord for questions
  • I'm not able to find an open issue that requests the same enhancement

Problem

When using Google models for FIM/AutoComplete, they will sometimes return <|file_separator|> at the end of their completion. This results in the end-users inability to use the autocomplete completion without removing <|file_separator|> manually for each suggestion.

Solution

Add the following bit of code to the postprocessCompletion function within core/autocomplete/postprocessing/index.ts

if (
    (llm.model.includes("gemini") || llm.model.includes("gemma")) &&
    completion.endsWith("<|file_separator|>")
  ) {
    // "<|file_separator|>" is 18 characters long
    completion = completion.slice(0, -18);
  }

I would like to submit the PR to have this merged, but I'm attempting to follow the contribution guide by creating an issue first. Please let me know how to proceed.

Metadata

Metadata

Labels

area:autocompleteRelates to the auto complete featurekind:enhancementIndicates a new feature request, imrovement, or extension

Type

No type

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions