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

[Bug] [rag] CrossEncoderRanker "index out of bounds" error #1523

Closed
4 of 15 tasks
FOkvj opened this issue May 16, 2024 · 0 comments · Fixed by #1531
Closed
4 of 15 tasks

[Bug] [rag] CrossEncoderRanker "index out of bounds" error #1523

FOkvj opened this issue May 16, 2024 · 0 comments · Fixed by #1531
Labels
bug Something isn't working Waiting for reply

Comments

@FOkvj
Copy link
Contributor

FOkvj commented May 16, 2024

Search before asking

  • I had searched in the issues and found no similar issues.

Operating system information

Linux

Python version information

3.10

DB-GPT version

main

Related scenes

  • Chat Data
  • Chat Excel
  • Chat DB
  • Chat Knowledge
  • Model Management
  • Dashboard
  • Plugins

Installation Information

Device information

Device CPU

Models information

RerankModel: bge-rerank-base

What happened

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.

What you expected to happen

  1. self._rerank.rank(new_candidates_with_score, query) -> self._model.predict(sentences=query_content_pairs) -> if isinstance(sentences[0], str):
  2. the value of new_candidates_with_score may be [] sometimes.

How to reproduce

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

Additional context

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!
@FOkvj FOkvj added bug Something isn't working Waiting for reply labels May 16, 2024
@FOkvj FOkvj mentioned this issue May 16, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Waiting for reply
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant