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

Fixed underscores and made merge indice calculation more robust #17

Merged
merged 4 commits into from
Dec 8, 2022
Merged

Fixed underscores and made merge indice calculation more robust #17

merged 4 commits into from
Dec 8, 2022

Conversation

sALTaccount
Copy link
Contributor

Previously, the merge indice calculation could fail rather easily, and didn't work with underscores. Now you can have things such as underscores in the middle of words (or at all), quotation marks, every symbol but a space in your search. The previous code would fail with a prompt such as hololive, amane_kanata, 1girl, angel_wings, hairclip, blue eyes and searching for angel_wings, as it would become angel</w> _</w> wings</w>, and the code couldn't handle punctuation anywhere but the end.

Fixed behavior with token merge indice calculation when it comes to punctuation and numbers
Fixed searching for underscores and made the searching more robust. Had to update this code to work with the commit that went through while I was making it.
Copy link
Member

@daemon daemon left a comment

Choose a reason for hiding this comment

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

Nicely done. I was planning to address it at some point, but you beat me to the punch.

@daemon daemon merged commit 854e6dd into castorini:main Dec 8, 2022
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