17 lines
977 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
# Run from the repository root. Does not alter system Python or start a resident model server.
smart_env="${SMART_EDIT_ENV_DIR:-$PWD/.venv-smart-edit}"
smart_python="${SMART_EDIT_SETUP_PYTHON:-python3.11}"
"$smart_python" -m venv "$smart_env"
"$smart_env/bin/python" -m pip install -r services/smart-edit/requirements.txt -r services/smart-edit/requirements-fonts.txt
if [[ " $* " == *" --with-asr "* || " $* " == *" --with-all "* ]]; then
"$smart_env/bin/python" -m pip install -r services/smart-edit/requirements-asr.txt
"$smart_env/bin/python" services/smart-edit/prepare_models.py
fi
if [[ " $* " == *" --with-separation "* || " $* " == *" --with-all "* ]]; then
"$smart_env/bin/python" -m pip install -r services/smart-edit/requirements-separation.txt
"$smart_env/bin/python" services/smart-edit/prepare_separation.py
fi
SMART_EDIT_PYTHON="$smart_env/bin/python" "$smart_env/bin/python" services/smart-edit/analyze.py --check