lightonai / pylate

Late Interaction Models Training & Retrieval
https://lightonai.github.io/pylate/
MIT License
175 stars 7 forks source link

Rerank function giving RuntimeError: he number of subscripts in the equation (3) does not match the number of dimensions (2) for operand 1 and no ellipsis was given #57

Closed John42506176Linux closed 2 months ago

John42506176Linux commented 2 months ago

Pytorch version: Version: 2.4.1

Full Error: Code: reranked_documents = rank.rerank( documents_ids=ids, queries_embeddings=queries_embeddings, documents_embeddings=documents_embeddings, ) RuntimeError: einsum(): the number of subscripts in the equation (3) does not match the number of dimensions (2) for operand 1 and no ellipsis was given image

NohTow commented 2 months ago

Hello,

It seems that the embeddings you are feeding to the rerank function does not have a correct shape. You have a boilerplate here that shows how to encode your queries and documents to work with rerank.

Could you check if your code corresponds and if not, send the code to reproduce the issue.

John42506176Linux commented 2 months ago

Hi @NohTow,

Thanks for the assistance, I didn't realize that rerank and the retrieval had different syntaxes for passing documents, my mistake. :)