Skip to content

Add support for JinaAI Re-rankers #582

New issue

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

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

Already on GitHub? # to your account

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

Add support for JinaAI Re-rankers #582

wants to merge 13 commits into from

Conversation

alvarobartt
Copy link
Member

What does this PR do?

This PR adds the JinaBertClassificationHead in order to support the JinaBERT re-ranking models as e.g. jinaai/jina-reranker-v1-turbo-en. Note that JinaBERT's classification head is exactly the same as standard BERT's.

Warning

This PR is not yet ready to be merged, as there seem to be some discrepancies between the Sentence Transformers and ONNX outputs (those are aligned), but the outputs for the default Candle backend is not, meaning that there may be something off somewhere. Also it has yet only been tested on CPU and MPS devices, CUDA support is still missing / pending.

Fixes #579

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline, Pull Request section?
  • Was this discussed/approved via a GitHub issue or the forum? Please add a link to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the documentation guidelines, and here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@alvarobartt alvarobartt marked this pull request as ready for review April 15, 2025 15:50
@alvarobartt alvarobartt requested review from Narsil and McPatate and removed request for McPatate April 16, 2025 16:50
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error: could not create backend -> jinaai/jina-reranker-v1-turbo-en
1 participant