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

Link to transformers.js node_modules is busted #1

Open
lucasgelfond opened this issue Aug 9, 2024 · 3 comments
Open

Link to transformers.js node_modules is busted #1

lucasgelfond opened this issue Aug 9, 2024 · 3 comments

Comments

@lucasgelfond
Copy link

lucasgelfond commented Aug 9, 2024

Clean install of `easy-embeddings', when I run it, the setup script fails with the following error:

Monkey patching for IoC of ONNX WASM runtime...
Copying transformers.js to node_modules...
node:fs:1691
  handleErrorFromBinding(ctx);
  ^

Error: ENOENT: no such file or directory, lstat 'node_modules/@xenova/transformers.js'
    at Object.lstatSync (node:fs:1691:3)
    at __node_internal_ (node:internal/fs/utils:843:8)
    at rmSync (node:fs:1293:13)
    at <anonymous> (/Users/focus/Projects/---/easy-embeddings/scripts/setup-transformers.ts:150:1)
    at ModuleJob.run (node:internal/modules/esm/module_job:217:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:308:24)
    at async loadESM (node:internal/process/esm_loader:42:7)
    at async handleMainPromise (node:internal/modules/run_main:66:12) {
  errno: -2,
  syscall: 'lstat',
  code: 'ENOENT',
  path: 'node_modules/@xenova/transformers.js'
}

Node.js v20.7.0

Currently debugging, will update in this thread

@lucasgelfond
Copy link
Author

see #2

@lucasgelfond
Copy link
Author

Getting some errors with resolution now too, hmm:


src/index.ts(6,8): error TS7016: Could not find a declaration file for module '@xenova/transformers.js'. '/Users/focus/Projects/---/easy-embeddings/node_modules/@xenova/transformers.js/dist/transformers.js' implicitly has an 'any' type.
  There are types at '/Users/focus/Projects/---/easy-embeddings/node_modules/@xenova/transformers.js/types/transformers.d.ts', but this result could not be resolved when respecting package.json "exports". The '@huggingface/transformers' library may need to update its package.json or typings.

@kyr0
Copy link
Owner

kyr0 commented Aug 10, 2024

Hi @lucasgelfond, thank you for opening this issue and providing a PR. As mentioned in the other issue, it might be possible to finally streamline this all, as it seems like the necessary changes have been introduced in both upstream repos onnxruntime and transformers.js in the meantime... (although also these are alpha versions - but at least they seem pinnable, leading to a deterministic behaviour for the setup script in the future, hopefully)

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

No branches or pull requests

2 participants