mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-05 01:50:27 +08:00
refactor: 优化嵌入生成过程,调整批处理大小和内存管理策略
This commit is contained in:
@@ -410,9 +410,8 @@ function parseProgressLine(line: string): ProgressInfo | null {
|
||||
if (line.includes('Generating embeddings') || line.includes('Creating embeddings')) {
|
||||
return { stage: 'embeddings', message: 'Generating embeddings...', percent: 70 };
|
||||
}
|
||||
if (line.includes('Finalizing') || line.includes('Complete')) {
|
||||
return { stage: 'complete', message: 'Finalizing...', percent: 95 };
|
||||
}
|
||||
// Note: "Finalizing index" and "Building ANN" are handled separately below
|
||||
// Only match generic "Complete" here (not "Finalizing" which has specific handlers)
|
||||
|
||||
// Parse indexed count: "Indexed X files" - FTS complete, but embeddings may follow
|
||||
const indexedMatch = line.match(/Indexed (\d+) files/i);
|
||||
@@ -460,6 +459,11 @@ function parseProgressLine(line: string): ProgressInfo | null {
|
||||
};
|
||||
}
|
||||
|
||||
// Parse generic completion (but not "Embeddings complete" which is handled above)
|
||||
if (line.includes('Complete') && !line.toLowerCase().includes('embeddings complete')) {
|
||||
return { stage: 'complete', message: 'Complete', percent: 98 };
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user