| #!/usr/bin/env bash |
| |
| |
| |
| |
| |
| |
| set -e |
| cd "$(dirname "$0")" |
|
|
| |
| export HF_HOME="$(pwd)/models_cache/huggingface" |
| export TRANSFORMERS_CACHE="$(pwd)/models_cache/huggingface" |
| export TORCH_HOME="$(pwd)/models_cache/torch" |
| export ULTRALYTICS_CONFIG_DIR="$(pwd)/models_cache/ultralytics" |
| export PIP_CACHE_DIR="$(pwd)/models_cache/pip" |
|
|
| mkdir -p models_cache |
|
|
| if [ ! -f ".venv/bin/activate" ]; then |
| echo "[1/3] No environment found — creating one in .venv ..." |
| python3 -m venv .venv |
| fi |
|
|
| echo "[2/3] Activating environment and installing/checking dependencies..." |
| source .venv/bin/activate |
| python -m pip install --upgrade pip -q |
| pip install -r requirements.txt |
|
|
| echo "[3/3] Launching app (first launch also downloads ~7GB of models into models_cache/)..." |
| python app.py |
|
|