Skip to content

Commit

Permalink
better filtering of model artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
sestinj committed Jun 3, 2024
1 parent d9f9fd0 commit c96780a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions core/autocomplete/lineStream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,16 @@ export async function* skipLines(stream: LineStream): LineStream {
}
}

const LINES_TO_REMOVE_BEFORE_START = [
"<COMPLETION>",
"[CODE]",
"<START EDITING HERE>",
];

function shouldRemoveLineBeforeStart(line: string): boolean {
return (
line.trimStart().startsWith("```") ||
line.trim() === "[CODE]" ||
line.trim() === "" ||
line.trim() === "<START EDITING HERE>"
LINES_TO_REMOVE_BEFORE_START.some((l) => line.trim() === l)
);
}

Expand Down

0 comments on commit c96780a

Please sign in to comment.