Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] LlamaIndex embeddings using wrong method #515

Closed
logan-markewich opened this issue Aug 19, 2024 · 5 comments
Closed

[Bug] LlamaIndex embeddings using wrong method #515

logan-markewich opened this issue Aug 19, 2024 · 5 comments
Assignees
Labels
aitce bug Something isn't working DEV features Hacktoberfest OPEAHack Issue created for OPEA Hackathon r1.1
Milestone

Comments

@logan-markewich
Copy link

The llamaindex tea embeddings are using a private method

embed_vector = embeddings._get_query_embedding(input.text)

It's not clear to me if the embedding service is meant to handle query embeddings or document embeddings. But either way, we should be using embed_model.get_text_embedding(text) or embed_model.get_query_embedding(query)

Likely we should have two endpoints, one for query and one for normal text documents.

We might also want to consider using get_text_embeddings_batch() instead of processing one document at a time, but again, depends on how we want to define our embedding endpoints

@logan-markewich logan-markewich changed the title LlamaIndex embeddings using wrong method [Bug] LlamaIndex embeddings using wrong method Aug 19, 2024
@srinarayan-srikanthan
Copy link
Collaborator

the object is used to call the functions, but agree that we might want to consider text_embedding_batch()

@logan-markewich
Copy link
Author

Right, but I think we also don't want to ignore the fact that its pretty common for embedding models to embed queries and documents differently (cohere and nomic are both examples that need this)

Maybe this needs to be a parameter on the request?

@logan-markewich
Copy link
Author

I've also noticed that the embeddings API in general only works by sending a single piece of text at a time. This is neither efficient nor openai compatible sadly

Related PR: run-llama/llama_index#16666

@srinarayan-srikanthan srinarayan-srikanthan added the DEV features label Nov 7, 2024
@srinarayan-srikanthan srinarayan-srikanthan removed their assignment Nov 7, 2024
@joshuayao joshuayao added the bug Something isn't working label Nov 8, 2024
@joshuayao joshuayao added this to OPEA Nov 8, 2024
@joshuayao joshuayao added this to the v1.1 milestone Nov 8, 2024
@Spycsh Spycsh assigned lkk12014402 and unassigned Spycsh Nov 8, 2024
@joshuayao joshuayao added the r1.1 label Nov 11, 2024
@joshuayao joshuayao moved this to In progress in OPEA Nov 12, 2024
@joshuayao joshuayao assigned XinyaoWa and unassigned lkk12014402 and kevinintel Nov 12, 2024
@XinyaoWa
Copy link
Collaborator

Hi, this problem has been fixed in PR #892

@joshuayao
Copy link
Collaborator

@logan-markewich Could you please help close the issue if the PR works? Thanks.

@github-project-automation github-project-automation bot moved this from In progress to Done in OPEA Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aitce bug Something isn't working DEV features Hacktoberfest OPEAHack Issue created for OPEA Hackathon r1.1
Projects
Status: Done
Development

No branches or pull requests

9 participants