Merge pull request #3341 from continuedev/nate/quick-edit-5814

postprocessing rule for no suffix
This commit is contained in:
Nate Sesti 2024-12-13 09:12:56 -08:00 • committed by GitHub
commit f2e801b3fd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -90,6 +90,17 @@ export function postprocessCompletion({
completion = completion.slice(1);
}
}
// When there is no suffix, Codestral tends to begin with a new line
// We do this to avoid double new lines
if (
suffix.length === 0 &&
prefix.endsWith("\n\n") &&
completion.startsWith("\n")
) {
// Remove a single leading \n from the completion
completion = completion.slice(1);
}
}
if (llm.model.includes("granite")) {