From 24b54dc53f39f97e5a07e385d472ce2c494f5fa0 Mon Sep 17 00:00:00 2001 From: Simone Vellei Date: Tue, 10 Sep 2024 18:48:07 +0200 Subject: [PATCH] fix --- embedder/llamacpp/llamacpp.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/embedder/llamacpp/llamacpp.go b/embedder/llamacpp/llamacpp.go index 632a124e..e8744576 100644 --- a/embedder/llamacpp/llamacpp.go +++ b/embedder/llamacpp/llamacpp.go @@ -84,15 +84,15 @@ func (l *LlamaCppEmbedder) embed(ctx context.Context, text string) (embedder.Emb } func parseEmbeddings(str string) (embedder.Embedding, error) { - var output output - err := json.Unmarshal([]byte(str), &output) + var out output + err := json.Unmarshal([]byte(str), &out) if err != nil { return nil, err } - if len(output.Data) != 1 { + if len(out.Data) != 1 { return nil, errors.New("no embeddings found") } - return output.Data[0].Embedding, nil + return out.Data[0].Embedding, nil }