Skip to content
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: Support rerank models #672

Merged
merged 6 commits into from
Nov 24, 2023
Merged

FEAT: Support rerank models #672

merged 6 commits into from
Nov 24, 2023

Conversation

aresnow1
Copy link
Contributor

@aresnow1 aresnow1 commented Nov 21, 2023

  • Add rerank type
  • Compatible with cohere rerank APIs
  • Support bge-reranker-large and bge-reranker-base
  • Support downloading from modelscope
  • Documentation

example for launching rerank model:

model_uid = client.launch_model(
        model_name="bge-reranker-large", model_type="rerank"
    )
model = client.get_model(model_uid)
query = "A man is eating pasta."
corpus = [
    "A man is eating food.",
    "A man is eating a piece of bread.",
    "The girl is carrying a baby.",
    "A man is riding a horse.",
    "A woman is playing violin.",
    "Two men pushed carts through the woods.",
    "A man is riding a white horse on an enclosed ground.",
    "A monkey is playing drums.",
    "A cheetah is running behind its prey.",
]
print(model.rerank(corpus, query))

@XprobeBot XprobeBot added this to the v0.6.4 milestone Nov 21, 2023
@aresnow1 aresnow1 marked this pull request as ready for review November 22, 2023 14:48
Copy link
Contributor

@codingl2k1 codingl2k1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@aresnow1 aresnow1 merged commit 3ddc112 into xorbitsai:main Nov 24, 2023
10 of 12 checks passed
@aresnow1 aresnow1 deleted the feat/rerank branch November 24, 2023 04:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants