You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] @huggingface/transformers model cache writes inside read-only asar, memory indexing fails with ENOTDIR #88
After fixing the dylib issue (#76), the memory service starts but indexing fails when it tries to download and cache the embedding model. The @huggingface/transformers library attempts to create a .cache/ directory inside the module's path, which resolves to inside the read-only app.asar archive.
Error
ENOTDIR: not a directory, mkdir '/Applications/Memmy.app/Contents/Resources/app.asar/dist/runtime/memory/node_modules/@huggingface/transformers/.cache/Xenova/all-MiniLM-L6-v2/onnx'
Root Cause
In Memory/src/model/embedder.ts, the ensureLocalExtractor function loads the model via:
No cache_dir or env.cacheDir is configured, so the library defaults to .cache/ relative to the module directory. Inside a packaged Electron app, this path is inside the read-only asar archive.
Workaround
Patch the compiled embedder.js to set a writable cache directory before loading the pipeline:
In Memory/src/model/embedder.ts, set env.cacheDir to a writable location (e.g., ~/.memmy/transformers-cache or the app's userData directory) before calling pipeline(). This ensures the model cache survives app updates and is writable in packaged builds.
Fixed by #102 (commit 514d963) and included in main via #112.
The Transformers model cache is now explicitly configured to use the writable
directory ~/.memmy/memory-service/model-cache, so packaged Electron builds no
longer attempt to write inside app.asar.
The regression test passes on the current main. Closing as completed.
Activity
hijzy commentedon Aug 4, 2026
Fixed by #102 (commit 514d963) and included in
mainvia #112.The Transformers model cache is now explicitly configured to use the writable
directory
~/.memmy/memory-service/model-cache, so packaged Electron builds nolonger attempt to write inside
app.asar.The regression test passes on the current
main. Closing as completed.Thanks for the detailed report!