From b7970da904c77095307329faad66f7f98a21b88a Mon Sep 17 00:00:00 2001 From: Nick Savage Date: Thu, 21 Nov 2024 18:58:19 -0500 Subject: [PATCH] backend: change model back and print elapsed time --- go-backend/llms/embeddings.go | 2 +- go-backend/main.go | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/go-backend/llms/embeddings.go b/go-backend/llms/embeddings.go index 336f9f9..6b63557 100644 --- a/go-backend/llms/embeddings.go +++ b/go-backend/llms/embeddings.go @@ -43,7 +43,7 @@ func GenerateEmbeddings(chunk models.CardChunk, useForQuery bool) ([]pgvector.Ve } payload := map[string]string{ - "model": "nomic-embed-text", + "model": "mxbai-embed-large", "prompt": prompt, } diff --git a/go-backend/main.go b/go-backend/main.go index 9c39e1c..c7c4a2f 100644 --- a/go-backend/main.go +++ b/go-backend/main.go @@ -4,13 +4,14 @@ import ( // "bytes" "context" //"encoding/json" + "fmt" "go-backend/handlers" "go-backend/models" "go-backend/server" "log" "net/http" "os" - // "time" + "time" "github.com/golang-jwt/jwt/v4" "github.com/gorilla/mux" @@ -136,6 +137,7 @@ func main() { if os.Getenv("ZETTEL_RUN_CHUNKING_EMBEDDING") == "true" { go func() { + start := time.Now() cards, _ := h.QueryFullCards(1, "") for _, card := range cards { err := h.ChunkCard(card) @@ -149,6 +151,9 @@ func main() { break } } + elapsed := time.Since(start) + + fmt.Printf("Operation took %v\n", elapsed) }()