-
-
Notifications
You must be signed in to change notification settings - Fork 66
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
feat: exposing onnx backend to JS land #436
Merged
Merged
+1,576
−79
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@kallebysantos Looks like you'd need to rebase :) |
nyannyacha
force-pushed
the
ai
branch
2 times, most recently
from
November 7, 2024 08:10
79ec34a
to
9b3767b
Compare
nyannyacha
force-pushed
the
ai
branch
2 times, most recently
from
November 7, 2024 11:48
d6b6e68
to
c695c6f
Compare
Simple integration between `transformers.js` and rust ort backend by exposing js owned API
- Implementing v8 traits to cast tensors `ToV8` and `FromV8`. - Resolving `ort::Tensor` type based on Js tensor's.
- Since `serde_v8` allows zero-copy we use it to handle the model inputs and send back the outputs
- Solved the "`GetMutableData` should not be a null pointer" error while executing seq2seq models. - Ref.: pykeio/ort#185
- Applying integration tests over all NLP pipelines with ort backend
- Applying integration tests over VISION pipelines with ort backend
laktek
approved these changes
Nov 12, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! thanks for the contribution @kallebysantos 🎊
🎉 This PR is included in version 1.62.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
Feature, Enhancement
What is the current behavior?
When using huggingface/transformers.js the model inference are
wasm
handled withonnxruntime-web
library.What is the new behavior?
This PR adds compatibility to exposed ORT feature. It allows to use
transformers.js
with the current native rust ORT and all its optimizations.How to use it
The
onnx
backend is implicitly exposed totransformers.js v3
and the only code change needed from final users is to adddevice: 'auto'
.Tested pipelines
NLP
feature-extraction
fill-mask
text-classification
token-classification
zero-shot-classification
text-generation
text2text-generation
translation
summarization
question-answering
Computer vision
image-feature-extraction
image-classification
zero-shot-image-classification