From c1344794143ef48670d8eeb365a10a5295a145ae Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Sat, 15 Feb 2025 11:09:47 +0300 Subject: Enha: log level to props --- rag/main.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'rag/main.go') diff --git a/rag/main.go b/rag/main.go index d4065e5..5f2aa00 100644 --- a/rag/main.go +++ b/rag/main.go @@ -49,7 +49,7 @@ func (r *RAG) LoadRAG(fpath string) error { if err != nil { return err } - r.logger.Info("rag: loaded file", "fp", fpath) + r.logger.Debug("rag: loaded file", "fp", fpath) LongJobStatusCh <- LoadedFileRAGStatus fileText := string(data) tokenizer, err := english.NewSentenceTokenizer(nil) @@ -105,7 +105,7 @@ func (r *RAG) LoadRAG(fpath string) error { ctn++ } finishedBatchesMsg := fmt.Sprintf("finished batching batches#: %d; paragraphs: %d; sentences: %d\n", len(batchCh), len(paragraphs), len(sents)) - r.logger.Info(finishedBatchesMsg) + r.logger.Debug(finishedBatchesMsg) LongJobStatusCh <- finishedBatchesMsg for w := 0; w < workers; w++ { go r.batchToVectorHFAsync(lock, w, batchCh, vectorCh, errCh, doneCh, path.Base(fpath)) @@ -127,9 +127,9 @@ func (r *RAG) writeVectors(vectorCh chan []models.VectorRow) error { // return err } } - r.logger.Info("wrote batch to db", "size", len(batch), "vector_chan_len", len(vectorCh)) + r.logger.Debug("wrote batch to db", "size", len(batch), "vector_chan_len", len(vectorCh)) if len(vectorCh) == 0 { - r.logger.Info("finished writing vectors") + r.logger.Debug("finished writing vectors") LongJobStatusCh <- FinishedRAGStatus defer close(vectorCh) return nil @@ -160,7 +160,7 @@ func (r *RAG) batchToVectorHFAsync(lock *sync.Mutex, id int, inputCh <-chan map[ lock.Unlock() return } - r.logger.Info("to vector batches", "batches#", len(inputCh), "worker#", id) + r.logger.Debug("to vector batches", "batches#", len(inputCh), "worker#", id) LongJobStatusCh <- fmt.Sprintf("converted to vector; batches: %d, worker#: %d", len(inputCh), id) } } -- cgit v1.2.3