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

Fix CrossEncoderRanker #1531

Merged
merged 4 commits into from
May 20, 2024
Merged

Fix CrossEncoderRanker #1531

merged 4 commits into from
May 20, 2024

Conversation

FOkvj
Copy link
Contributor

@FOkvj FOkvj commented May 16, 2024

Description

When using CrossEncoderRanker as a ranker for EmbeddingRetrieve, calling the rank function of CrossEncoderRanker results in an "index out of bounds" error when the length of the retrieved results is 0.
Close #1523

How Has This Been Tested?

ranker = CrossEncoderRanker(topk=3, model=os.path.join(MODEL_PATH, rerank_model))
ranker.rank(candidates_with_scores=[], query="what happened")

Snapshots:

截屏2024-05-16 18 50 03

Checklist:

  • My code follows the style guidelines of this project
  • I have already rebased the commits and make the commit message conform to the project standard.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • Any dependent changes have been merged and published in downstream modules

@csunny
Copy link
Collaborator

csunny commented May 20, 2024

@FOkvj Thanks for your PR, but I don’t see any file changes here. maybe this has been changed and merged to the latest version?

Copy link
Collaborator

@csunny csunny left a comment

Choose a reason for hiding this comment

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

r+

Copy link
Collaborator

@Aries-ckt Aries-ckt left a comment

Choose a reason for hiding this comment

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

r+

@Aries-ckt Aries-ckt merged commit 04af30e into eosphoros-ai:main May 20, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] [rag] CrossEncoderRanker "index out of bounds" error
3 participants