xenova / transformers.js

State-of-the-art Machine Learning for the web. Run 🤗 Transformers directly in your browser, with no need for a server!
https://huggingface.co/docs/transformers.js
Apache License 2.0
9.82k stars 578 forks source link

[Web] having trouble with loading models from local path #730

Closed 808vita closed 2 months ago

808vita commented 2 months ago

System Info

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

Environment/Platform

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) https://github.com/xenova/transformers.js/issues/502#issuecomment-1878655983

image

ps. https://github.com/microsoft/onnxruntime/issues/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
808vita commented 2 months ago

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.