Merge pull request #6194 from hayden-cardwell/main
fix(autocomplete): trim trailing <|file_separator|> for Gemini/Gemma
This commit is contained in:
@@ -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(" ")) {
|
||||
|
||||
Reference in New Issue
Block a user