-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstart.sh
More file actions
38 lines (32 loc) · 832 Bytes
/
Copy pathstart.sh
File metadata and controls
38 lines (32 loc) · 832 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env bash
# ContextCache — one-command startup
# Usage:
# ./start.sh # Demo mode (no GPU)
# ./start.sh --live # Live mode (requires GPU)
set -e
cd "$(dirname "$0")"
MODE="--demo"
EXTRA_ARGS=""
for arg in "$@"; do
case "$arg" in
--live) MODE="" ;;
*) EXTRA_ARGS="$EXTRA_ARGS $arg" ;;
esac
done
# Create venv if it doesn't exist
if [ ! -d ".venv" ]; then
echo "Creating virtual environment..."
python3 -m venv .venv
fi
# Activate
source .venv/bin/activate
# Install dependencies
if [ -n "$MODE" ]; then
echo "Installing demo dependencies..."
pip install -q fastapi uvicorn pydantic pyyaml
else
echo "Installing full dependencies (including PyTorch)..."
pip install -q -r requirements.txt
fi
echo ""
python scripts/serve/launch.py $MODE $EXTRA_ARGS