mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix: use MODELS_PATH env var for AI model paths instead of hardcoded /opt/models
The on-demand feature download system stores models at /data/ai/models/ (set via MODELS_PATH env var), but all Python scripts hardcoded /opt/models/ as the base path. Each script now reads MODELS_PATH and falls back to /opt/models for backward compatibility.
This commit is contained in:
@@ -12,7 +12,8 @@ def emit_progress(percent, stage):
|
||||
# Resolve the LaMa ONNX model path.
|
||||
# Docker places it at /opt/models/lama/lama_fp32.onnx.
|
||||
# For local dev, check a user-writable cache dir.
|
||||
LAMA_MODEL_DIR = os.environ.get("LAMA_MODEL_DIR", "/opt/models/lama")
|
||||
_MODELS_BASE = os.environ.get("MODELS_PATH", "/opt/models")
|
||||
LAMA_MODEL_DIR = os.environ.get("LAMA_MODEL_DIR", os.path.join(_MODELS_BASE, "lama"))
|
||||
LAMA_MODEL_PATH = os.path.join(LAMA_MODEL_DIR, "lama_fp32.onnx")
|
||||
LAMA_LOCAL_CACHE = os.path.join(os.path.expanduser("~"), ".cache", "ashim", "lama")
|
||||
LAMA_LOCAL_PATH = os.path.join(LAMA_LOCAL_CACHE, "lama_fp32.onnx")
|
||||
|
||||
Reference in New Issue
Block a user