AnswerDotAI / rerankers

A lightweight, low-dependency, unified API to use all common reranking and cross-encoder models.
Apache License 2.0
784 stars 40 forks source link

feat: adds compatibility for reranking using text-embeddings-inference server #20

Closed srisudarsan closed 1 month ago

srisudarsan commented 1 month ago

Adds support using text-embeddings-inference server (TEI) for reranking.

Fixes https://github.com/AnswerDotAI/rerankers/issues/2

Sample code:

from rerankers import Reranker
ranker = Reranker("text-embeddings-inference", url="http://localhost:8084/rerank",api_key=None)
results = ranker.rank(query="I love you", docs=["I hate you", "I really like you"], doc_ids=[0, 1])
bclavie commented 1 month ago

Thank you! I haven't yet gotten around to adding automated tests (coming this summer) so will run the proto-tests on this and merge in the next few days if all looks good!

bclavie commented 1 month ago

LGTM, Thank you! Will release early next week