feat: progress reporting during corpus embedding
Emit a `… embedded N/total (pct%)` line every 1000 items (and at completion) so a full --confirm run is observable rather than silent for its full duration. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -72,9 +72,16 @@ pub fn build_corpus_embeddings(
|
|||||||
.filter(|t| !store.has(t))
|
.filter(|t| !store.has(t))
|
||||||
.cloned()
|
.cloned()
|
||||||
.collect();
|
.collect();
|
||||||
|
let total = pending.len();
|
||||||
let mut done = 0;
|
let mut done = 0;
|
||||||
|
let mut last_report = 0;
|
||||||
for chunk in pending.chunks(batch.max(1)) {
|
for chunk in pending.chunks(batch.max(1)) {
|
||||||
done += embed_batch(client, store, model, chunk)?;
|
done += embed_batch(client, store, model, chunk)?;
|
||||||
|
if done - last_report >= 1000 || done == total {
|
||||||
|
let pct = if total == 0 { 100.0 } else { 100.0 * done as f64 / total as f64 };
|
||||||
|
eprintln!(" … embedded {done}/{total} ({pct:.1}%)");
|
||||||
|
last_report = done;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Ok(done)
|
Ok(done)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user