AnswerDotAI / rerankers

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

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

Closed srisudarsan closed 3 months ago

srisudarsan commented 3 months 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 3 months 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 3 months ago

LGTM, Thank you! Will release early next week