Merge pull request #6194 from hayden-cardwell/main
fix(autocomplete): trim trailing <|file_separator|> for Gemini/Gemma
This commit is contained in:
commit
cabc0da4e6
1 changed files with 8 additions and 0 deletions
|
|
@ -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(" ")) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue