nutrition: pre-download HuggingFace models at build time

The deployment server couldn't fetch transformer models at runtime due to
restricted network access and permission errors writing to node_modules.
Add a prebuild script to download models during build and document
TRANSFORMERS_CACHE env var for configuring a shared writable cache path.
This commit is contained in:
2026-04-02 20:47:04 +02:00
parent 07610a498f
commit fe17af66fc
3 changed files with 21 additions and 1 deletions
+3
View File
@@ -33,3 +33,6 @@ DEEPL_API_URL="https://api-free.deepl.com/v2/translate" # Use https://api.deepl
# AI Vision Service (Ollama for Alt Text Generation)
OLLAMA_URL="http://localhost:11434" # Local Ollama server URL
# HuggingFace Transformers Model Cache (for nutrition embedding models)
TRANSFORMERS_CACHE="/var/cache/transformers" # Must be writable by build and runtime user