-
Notifications
You must be signed in to change notification settings - Fork 124
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
feat: Fastembed - add FastembedRanker #1178
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey! Thank you for this PR.
I've had a first look and it seems good.
I have an idea: in general, we have an embedding backend for local Embedders because we expect users to use both Text Embedder and Doc Embedder based on the same model; this saves resources (the model is loaded only once).
For rankers, we don't have this problem.
So I would ask you to remove the backend and do everything in the component (Cohere can be taken as example).
Let me know and thanks again!
integrations/fastembed/src/haystack_integrations/components/rankers/fastembed/ranker.py
Outdated
Show resolved
Hide resolved
integrations/fastembed/src/haystack_integrations/components/rankers/fastembed/ranker.py
Show resolved
Hide resolved
integrations/fastembed/src/haystack_integrations/components/rankers/fastembed/ranker.py
Outdated
Show resolved
Hide resolved
integrations/fastembed/src/haystack_integrations/components/rankers/fastembed/ranker.py
Outdated
Show resolved
Hide resolved
integrations/fastembed/src/haystack_integrations/components/rankers/fastembed/ranker.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, this PR is almost ready to be merged.
TODO:
- modify this line in README to mention ranker:
haystack-core-integrations/README.md
Line 37 in c343776
| [fastembed-haystack](integrations/fastembed/) | Embedder | [![PyPI - Version](https://img.shields.io/pypi/v/fastembed-haystack.svg)](https://pypi.org/project/fastembed-haystack/) | [![Test / fastembed](https://github.com/deepset-ai/haystack-core-integrations/actions/workflows/fastembed.yml/badge.svg)](https://github.com/deepset-ai/haystack-core-integrations/actions/workflows/fastembed.yml) | - add more tests if you can/want (uncovered lines: 66-67, 109, 115->exit, 162-163, 166, 170-171, 174-175)
Then, if you also want to open a PR on haystack-integrations to update this page ( https://github.com/deepset-ai/haystack-integrations/blob/main/integrations/fastembed.md), it would be appreciated - otherwise, I'll take care of it.
integrations/fastembed/src/haystack_integrations/components/rankers/fastembed/ranker.py
Outdated
Show resolved
Hide resolved
I updated the Readme and added tests.
I'll make the PR on the other repo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
something is failing with merging this PR. |
Proposed Changes:
New feature: integrate with the new ranker from fastembed. (https://qdrant.tech/articles/cross-encoder-integration-gsoc/, https://github.com/qdrant/fastembed/tree/main?tab=readme-ov-file#-rerankers)
I based my code on CohereRanker and Fastembed existing code
How did you test it?
I wrote all the tests in test_fastembed_ranker.py, based on the other tests for fastembed.
Checklist
fix:
,feat:
,build:
,chore:
,ci:
,docs:
,style:
,refactor:
,perf:
,test:
.