-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
HuggingFace failure #7877
Comments
Slightly more detail
|
Digging around this seems to be the culprit, but it makes no sense to me:
|
I went to the onnx which is where the errors are happening. I found a simple example that uses node: It works fine. However... When I change it to require Weird. I get this error:
Run the same thing in node and I get:
That is obviously a different error. And it has to deal with Workers. |
There is an issue for the above: |
Note here: "It's a known issue that onnxruntime-web multi-thread not loading in node.js." microsoft/onnxruntime#17274 (comment) "@xenova/transformers" is surely using the web version and not the node version and thus the cause of this issue. [Edit: this is false, it determines which to use and correctly does so.] |
OK, it was dealing with workers and wasm as a backup if the native code failed. ONNX on node with WASM can only use one thread, so I have a one line fix for "@xenova/transformers". With that fix, it appears to work just fine but it is much slower than it should be. So the bug is a failure in the native code that works fine with node but fails with bun. Things run slower as it runs the native code first, loads the model and bails, then loads the wasm, loads the model, and succeeds. On a browser it can use multiple threads. So the browser version is faster than bun and the node version is faster than bun unless bun can run the native module (assuming using my fix). |
I went through building onnx runtime and the node build both in debug and found everything to work and not error. Long story short, onnx has already fixed the issue but "xenova/transformers" is using an old version. |
Main fix: huggingface/transformers.js#488 |
heyy man @sroussey what worked for you ? I am currently getting this error in bun trying to run embeddings , please I really need help , this has me stuck for a few days now |
Use my version temporarily @sroussey/transformers |
@sroussey thank you i had same issue huggingface/transformers.js#558 your version fixed |
It's just temporary until fixed upstream. |
But glad you have it working! |
As mentioned in huggingface/transformers.js#489 it should be solved in the v3 branch of transformers.js! |
hmm... |
What version of Bun is running?
1.0.20
What platform is your computer?
Darwin 23.2.0 arm64 arm
What steps can reproduce the bug?
What is the expected behavior?
Something not an error...
What do you see instead?
Additional information
No response
The text was updated successfully, but these errors were encountered: