Merge pull request #6194 from hayden-cardwell/main

fix(autocomplete): trim trailing <|file_separator|> for Gemini/Gemma
This commit is contained in:
Nate Sesti
2025-07-03 18:10:11 -07:00
committed by GitHub

View File

@@ -132,6 +132,14 @@ export function postprocessCompletion({
completion = "\n" + completion;
}
if (
(llm.model.includes("gemini") || llm.model.includes("gemma")) &&
completion.endsWith("<|file_separator|>")
) {
// "<|file_separator|>" is 18 characters long
completion = completion.slice(0, -18);
}
// If prefix ends with space and so does completion, then remove the space from completion
if (prefix.endsWith(" ") && completion.startsWith(" ")) {