Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
henomis committed Sep 10, 2024
1 parent 6fc5365 commit 24b54dc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions embedder/llamacpp/llamacpp.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 24b54dc

Please sign in to comment.