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

Error in adding sentence embeddings to existing index #244

Closed
anetschka opened this issue Jul 17, 2020 · 4 comments
Closed

Error in adding sentence embeddings to existing index #244

anetschka opened this issue Jul 17, 2020 · 4 comments
Assignees
Labels
type:bug Something isn't working

Comments

@anetschka
Copy link

Description
I am trying to use haystack with a sentence embedding model from the sentence-transformers library. Calling indexer.update_embeddings(embedding_retriever) results in an AttributeError.

Error message
line 318, in update_embeddings
"doc": {self.embedding_field: emb.tolist()},
AttributeError: 'list' object has no attribute 'tolist'

So something does not work in the handling of the embeddings given by the model.

System:

  • Haystack version (commit or version number): cloned yesterday
  • DocumentStore: ElasticsearchDocumentStore(host="localhost", username="", password="", index="document", embedding_field="embedding", embedding_dim=768)
  • Retriever: EmbeddingRetriever(indexer, model_format='sentence_transformers', embedding_model='distiluse-base-multilingual-cased')
@anetschka anetschka added the type:bug Something isn't working label Jul 17, 2020
@tholor tholor self-assigned this Jul 17, 2020
@tholor
Copy link
Member

tholor commented Jul 17, 2020

Thanks for reporting @anetschka ! I am able to reproduce this and already found the bug. While the DensePassageRetriever returns a List[ndarray], the EmbeddingRetriever returns List[List[float]]. I will add a fix for this

@anetschka
Copy link
Author

Prima! Allerbesten Dank!

@tholor
Copy link
Member

tholor commented Jul 17, 2020

Should be fixed with #245. Can you please try to pull & install from latest master?

@anetschka
Copy link
Author

I confirm that the bug is fixed, closing the ticket,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants