Refactor LLMStreamComplete to handle empty lines in removeRepeatBlock

This commit is contained in:
bobo.yang 2024-06-06 18:35:20 +08:00
parent 74bbe6f212
commit a1b10487a3

View File

@ -277,8 +277,8 @@ export class LLMStreamComplete {
// whether lines are repeated some block before
async removeRepeatBlock(lines: string[]): Promise< string[] > {
if (lines.length === 0) {
return [];
if (lines.length <= 1) {
return lines;
}
// find first match line in before 50 lines