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 crash with cosine similarity scores #364

Merged
merged 2 commits into from
Apr 30, 2023

Conversation

laptou
Copy link
Contributor

@laptou laptou commented Apr 30, 2023

Fixes #363. The issue was that using squeeze() was collapsing the similarities vector into a scalar (0-dimensional tensor) if there was only one item, which was messing up the shape and causing an error upon calling .iter::<f64>(). Using .view([-1]) instead solves the problem.

@guillaume-be
Copy link
Owner

Thank you for the PR!

@guillaume-be guillaume-be merged commit c37eb32 into guillaume-be:master Apr 30, 2023
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.

Keyword extraction model panics on some texts
2 participants