huggingface/transformers.js

Build from source instructions

Closed this issue · 4 comments

System Info

Building from source

Description

I am trying to build transformers.js from github directly, but running into errors. I can't find any README instructions either. I thought maybe I just could run yarn dev but that is giving me errors.

Is there another command I should be running perhaps?

Reproduction

  1. Clone transformers.js repository
  2. Run yarn dev
  3. See error
[webpack-cli] Error: Unique ports must be specified for each devServer option in your webpack configuration. Alternatively, run only 1 devServer config using the --config-name flag to specify your desired config.
    at Command.<anonymous> (/Users/paul.dufour/transformers.js/node_modules/@webpack-cli/serve/lib/index.js:152:31)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Command.parseAsync (/Users/paul.dufour/transformers.js/node_modules/commander/lib/command.js:935:5)
    at async Command.<anonymous> (/Users/paul.dufour/transformers.js/node_modules/webpack-cli/lib/webpack-cli.js:1356:13)
    at async Command.parseAsync (/Users/paul.dufour/transformers.js/node_modules/commander/lib/command.js:935:5)
    at async WebpackCLI.run (/Users/paul.dufour/transformers.js/node_modules/webpack-cli/lib/webpack-cli.js:1360:9)
    at async runCLI (/Users/paul.dufour/transformers.js/node_modules/webpack-cli/lib/bootstrap.js:9:9)

Expected Results:
Should run the dev server.

Hi there 👋 You should be able to do something similar to:

npm install huggingface/transformers.js

Hi @xenova I was more thinking if I wanted to make changes to transformers.js and then test them locally.

In that case, you should be able to:

You should be able to import using a relative path to ./src/transformers.js. This is how I do it :)

Otherwise, you can do this:

  1. Run npm run build in transformers.js root folder
  2. Run npm link in transformers.js root folder
  3. Run npm link @huggingface/transformers in your testing folder

Thanks that works