xenova / transformers.js

State-of-the-art Machine Learning for the web. Run 🤗 Transformers directly in your browser, with no need for a server!

Home Page:https://huggingface.co/docs/transformers.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Web] having trouble with loading models from local path

808vita opened this issue · comments

System Info

"@xenova/transformers": "^2.17.1",
"next": "14.2.3",
"react": "^18",
"react-dom": "^18"

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

Describe the issue

I'm trying to load the models from the public folder in nextjs v14 dev / build, facing issues. I tried to search related issues but still stuck.
When the model is loaded from hugging face , it runs as expected.

some screenshots:
image

image

I did set the local path as /models/, with trailing slash (console does show thprogress of the files being loaded)
#502 (comment)

image

ps.
microsoft/onnxruntime#20491
created a issue /report there as well (by mistake. at that time searched github for related issues , ended up there and oof.) i will close that.

Reproduction

  1. Setup nextjs v14
  2. setup text generation pipeline
  3. try to load model files from local path

was able to identify what was causing this issue .
I already had git installed in my system, assumed this would be enough.

Try running git lfs --version in the terminal , if you receive errors relating to this command does not exist , the cloning of bigger files are not completed properly.

you need to install git-lfs to properly clone.
if you are in ubuntu please use sudo apt-get install git-lfs to install it.
After installation please try cloning the hugging face repo and try loading it locally again.

Closing this issue.