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

error when running simple example from @xenova/transformers #11825

Closed
universalmind303 opened this issue Jun 12, 2024 · 2 comments
Closed

error when running simple example from @xenova/transformers #11825

universalmind303 opened this issue Jun 12, 2024 · 2 comments
Labels
bug Something isn't working needs triage

Comments

@universalmind303
Copy link

universalmind303 commented Jun 12, 2024

What version of Bun is running?

1.1.13+bd6a60512

What platform is your computer?

Darwin 23.4.0 arm64 arm

What steps can reproduce the bug?

bun add @xenova/transformers
// index.js
import { pipeline } from "@xenova/transformers";

// Allocate a pipeline for sentiment-analysis
const pipe = await pipeline("sentiment-analysis");

const out = await pipe("I love transformers!");

console.log(out);
bun run index.js

What is the expected behavior?

> node index.js
No model specified. Using default model: "Xenova/distilbert-base-uncased-finetuned-sst-2-english".
[ { label: 'POSITIVE', score: 0.999788761138916 } ]

What do you see instead?

❯ bun run index.ts                                                     06/12/2024 06:38:01 PM
No model specified. Using default model: "Xenova/distilbert-base-uncased-finetuned-sst-2-english".
22 |         __classPrivateFieldSet(this, _OnnxruntimeSessionHandler_inferenceSession, new binding_1.binding.InferenceSession(), "f");
23 |         if (typeof pathOrBuffer === 'string') {
24 |             __classPrivateFieldGet(this, _OnnxruntimeSessionHandler_inferenceSession, "f").loadModel(pathOrBuffer, options);
25 |         }
26 |         else {
27 |             __classPrivateFieldGet(this, _OnnxruntimeSessionHandler_inferenceSession, "f").loadModel(pathOrBuffer.buffer, pathOrBuffer.byteOffset, pathOrBuffer.byteLength, options);
                                                                                                ^
error: Error
      at new OnnxruntimeSessionHandler (/Users/me/Development/bun-transformers/node_modules/.deno/[email protected]/node_modules/onnxruntime-node/dist/backend.js:27:92)
      at /Users/me/Development/bun-transformers/node_modules/.deno/[email protected]/node_modules/onnxruntime-node/dist/backend.js:64:29

Something went wrong during model construction (most likely a missing operation). Using `wasm` as a fallback.
[
  {
    label: "POSITIVE",
    score: 0.999788761138916,
  }
]

Additional information

When running via bun, the js process never terminates either

@universalmind303 universalmind303 added bug Something isn't working needs triage labels Jun 12, 2024
@Jarred-Sumner
Copy link
Collaborator

Duplicate of #4619

@Jarred-Sumner Jarred-Sumner marked this as a duplicate of #4619 Jun 12, 2024
@Jarred-Sumner
Copy link
Collaborator

We are tracking this in #4619. Please follow along there.

@Jarred-Sumner Jarred-Sumner closed this as not planned Won't fix, can't repro, duplicate, stale Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

2 participants