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

Add binary embedding quantization support to FeatureExtraction pipeline #691

Merged
merged 6 commits into from
Apr 10, 2024

Conversation

jonathanpv
Copy link
Contributor

@jonathanpv jonathanpv commented Apr 10, 2024

This PR addressed the below issue, using the examples from @xenova.

  • Closes [feat] Add binary & scalar embedding quantization support to Transformers.js #681

  • Let me know if you'd like any changes to this, perhaps we can make another options object in javascript like a QuantizationOptions so it's obvious which parameters are grouped together logically

  • I also added a texts === undefined check since I ran into an issue earlier where I was accidentally not passing in any texts and was met with an unfriendly error.

For some reason though I don't get the same similarity numbers as Xenova did on his example but the numbers are at least similar

It may also be beneficial to bring in https://github.com/ashvardanian/SimSIMD for this but haven't ran any benchmarks within browser context yet

Copy link
Collaborator

@xenova xenova left a comment

Choose a reason for hiding this comment

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

Thanks so much!

src/utils/tensor.js Outdated Show resolved Hide resolved
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Collaborator

@xenova xenova left a comment

Choose a reason for hiding this comment

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

nits

src/utils/tensor.js Outdated Show resolved Hide resolved
src/utils/tensor.js Show resolved Hide resolved
src/utils/tensor.js Outdated Show resolved Hide resolved
src/utils/tensor.js Outdated Show resolved Hide resolved
src/pipelines.js Outdated Show resolved Hide resolved
src/pipelines.js Outdated Show resolved Hide resolved
src/pipelines.js Outdated Show resolved Hide resolved
@xenova xenova merged commit f71ee32 into huggingface:main Apr 10, 2024
1 of 4 checks passed
@xenova
Copy link
Collaborator

xenova commented Apr 10, 2024

Great job! Thanks for the PR! 🔥

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.

[feat] Add binary & scalar embedding quantization support to Transformers.js
3 participants