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

Load large model files 2GB+(external data) using WebAssembly (up to 4 GB). #726

Closed young-developer closed 1 month ago

young-developer commented 2 months ago

When I tried to load external data for larger models(2GB+) it crashes on allocation. When I use WebAssembly for allocation with predefined page size it loads correctly.

Known issues: Promise cant cache large files and if model(external data file) is large it will download it again without caching. Some sort of chunk loading should be added to be able to cache larger models.