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

An error on musicgen-web example #1078

Open
1 of 5 tasks
porry420 opened this issue Dec 7, 2024 · 3 comments
Open
1 of 5 tasks

An error on musicgen-web example #1078

porry420 opened this issue Dec 7, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@porry420
Copy link

porry420 commented Dec 7, 2024

System Info

OS: Windows 10
node version 20.16.0
npm version10.8,1

Environment/Platform

  • Website/web-app
  • Browser extension
  • Server-side (e.g., Node.js, Deno, Bun)
  • Desktop app (e.g., Electron)
  • Other (e.g., VSCode extension)

Description

I tired to run this example.
And I have got an error like this.

X [ERROR] Failed to resolve entry for package "@xenova/transformers". The package may have incorrect main/module/exports specified in its package.json. [plugin vite:dep-scan]

node_modules/esbuild/lib/main.js:1225:21:
  1225 │         let result = await callback({

Reproduction

clone full repository.
go to sub direcoty
npm install
npm run dev

@porry420 porry420 added the bug Something isn't working label Dec 7, 2024
@SeanGallen
Copy link
Contributor

@porry420, I was able to reproduce the bug. I have a PR with a potential solution here, if you would like to try. I was able to get it working with those changes.

@porry420
Copy link
Author

porry420 commented Dec 9, 2024

I am going to change this Musicgen-web so that it can run without the internet. I have followed the custom usage instructions, but it is not working correctly. Can you give me more details?

@SeanGallen
Copy link
Contributor

Here are the steps I used to get it working with it connected to the internet:

In the package.json change the "@xenova/transformers": "github:xenova/transformers.js#v3" to "@huggingface/transformers": "^3.1.2",.
In the examples/musicgen-web/src/App.jsx, change "@xenova/transformers to @huggingface/transformers

Just to be safe, remove the "@xenova/transformers from your node_modules. npm uninstall @xenova/transformers.
Run npm install in the root of the musicgen-web, to re-install all the packages.

This should get it working locally for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants