Skip to content

Commit 22a3672

Browse files
committed
store embedding meta data on start
This way errors during the a new embedding run will not trigger a clear index on retry
1 parent 8502e30 commit 22a3672

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

cli.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -366,15 +366,14 @@ protected function createEmbeddings($clear)
366366
$clear = true;
367367
}
368368

369+
$data['embed ran at'] = dformat();
370+
$data['embed used'] = (string) $this->helper->getEmbeddingModel();
371+
$this->helper->setRunData($data);
372+
369373
$start = time();
370374
$this->helper->getEmbeddings()->createNewIndex($skipRE, $matchRE, $clear);
371375
$this->notice('Peak memory used: {memory}', ['memory' => filesize_h(memory_get_peak_usage(true))]);
372376
$this->notice('Spent time: {time}min', ['time' => round((time() - $start) / 60, 2)]);
373-
374-
375-
$data['embed ran at'] = dformat();
376-
$data['embed used'] = (string) $this->helper->getEmbeddingModel();
377-
$this->helper->setRunData($data);
378377
}
379378

380379
/**

0 commit comments

Comments
 (0)