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

Cast predict scores to float before converting to numpy #2783

Merged
merged 2 commits into from
Jun 26, 2024

Conversation

malteos
Copy link
Contributor

@malteos malteos commented Jun 26, 2024

Torch might throw a type error (see pytorch/pytorch#109873) when a model uses a different precision (e.g., bf16). Casting the scores to float first fixes this.

I encountered this error when evaluating the recent Jina reranker (https://huggingface.co/jinaai/jina-reranker-v2-base-multilingual).

Torch might throw a type error (see pytorch/pytorch#109873) when a model uses a different precision (e.g., bf16). Casting the scores to float fixes this.
@tomaarsen
Copy link
Collaborator

Hello!

I got the exact same behaviour myself! You beat me to the PR 😄 Thanks a bunch.

  • Tom Aarsen

@tomaarsen tomaarsen merged commit 8ce142b into UKPLab:master Jun 26, 2024
9 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.

2 participants