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: DBSF reranker ZeroDivisionError #871

Closed
pavelm10 opened this issue Dec 31, 2024 · 0 comments
Closed

bug: DBSF reranker ZeroDivisionError #871

pavelm10 opened this issue Dec 31, 2024 · 0 comments

Comments

@pavelm10
Copy link
Contributor

DBSF reranker crashes with ZeroDivisionError when number of results is 1

def normalize(response: List[models.ScoredPoint]) -> List[models.ScoredPoint]:
        total = sum([point.score for point in response])
        mean = total / len(response)
>       variance = sum([(point.score - mean) ** 2 for point in response]) / (len(response) - 1)
E       ZeroDivisionError: float division by zero
pavelm10 added a commit to pavelm10/qdrant-client that referenced this issue Dec 31, 2024
@pavelm10 pavelm10 mentioned this issue Dec 31, 2024
3 tasks
generall added a commit that referenced this issue Jan 2, 2025
* fix: dbsf zero division error

closes #871

* review suggestion

Co-authored-by: Andrey Vasnetsov <[email protected]>

---------

Co-authored-by: Andrey Vasnetsov <[email protected]>
pavelm10 added a commit to pavelm10/qdrant-client that referenced this issue Jan 3, 2025
pavelm10 added a commit to pavelm10/qdrant-client that referenced this issue Jan 3, 2025
@pavelm10 pavelm10 mentioned this issue Jan 3, 2025
8 tasks
joein added a commit that referenced this issue Jan 6, 2025
* fix: dbsf zero variance

solves #871

* review suggestions

* fix: fix dbsf single response score

---------

Co-authored-by: George Panchuk <[email protected]>
@joein joein closed this as completed in c57f10d Jan 16, 2025
joein added a commit that referenced this issue Jan 16, 2025
* fix: dbsf zero variance

solves #871

* review suggestions

* fix: fix dbsf single response score

---------

Co-authored-by: George Panchuk <[email protected]>
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

No branches or pull requests

1 participant