Skip to content
Discussion options

You must be logged in to vote

The issue arises because the server's response JSON contains an 'embedding' key instead of the expected 'results' key. To resolve this, you can transform the response to include the 'results' key with the appropriate structure. Here's how you can modify the _get_text_embeddings method in the LlamafileEmbedding class to handle this:

  1. Transform the response to include the 'results' key if it is missing.
  2. Update the embedding extraction logic to use the transformed response.

Here's the updated code:

import httpx
from llama_index.embeddings.llamafile import LlamafileEmbedding
from llama_index.core import Settings
from llama_index.llms.llamafile import Llamafile
from llama_index.core.node_parser

Replies: 5 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@dosubot
Comment options

Comment options

You must be logged in to vote
1 reply
@dosubot
Comment options

Answer selected by muz-sup
Comment options

You must be logged in to vote
1 reply
@dosubot
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant