start_songcentric_shortest_path.sh
746 Bytes
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
PYTHON_BIN="${PYTHON_BIN:-/usr/local/miniconda3/bin/python}"
DSN="${1:-${PG_DSN:-}}"
SCHEMA="${2:-${PG_SCHEMA:-acr_songcentric_test}}"
INPUT_ROOT="${3:-$ROOT_DIR/data/songcentric_builder_smoke}"
OUTPUT_DIR="${4:-$ROOT_DIR/data/pgvector_eval/music20}"
if [[ -z "$DSN" ]]; then
echo "usage: $0 <postgres-dsn> [schema] [input-root] [output-dir]" >&2
echo "or set PG_DSN before running this script" >&2
exit 1
fi
cd "$ROOT_DIR/.."
"$PYTHON_BIN" acr-engine/scripts/run_songcentric_directory_pipeline_live.py \
--dsn "$DSN" \
--schema "$SCHEMA" \
--input-root "${INPUT_ROOT#$ROOT_DIR/..\/}" \
--output-dir "${OUTPUT_DIR#$ROOT_DIR/..\/}"