Spaces:
Sleeping
Sleeping
File size: 1,031 Bytes
f0b07c1 91ff7bb f0b07c1 91ff7bb f0b07c1 82d8767 f0b07c1 91ff7bb f0b07c1 91ff7bb f0b07c1 82d8767 | 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 39 40 41 | #!/bin/bash
set -e
REPO_URL="https://github.com/JsonLord/agent-zero.git"
CLONE_DIR="/home/user/app/agent-zero-clone"
APP_DIR="/home/user/app"
PATCHES_DIR="/home/user/app/patches"
echo "Cloning Agent-Zero (main branch) into temporary directory..."
if [ -d "$CLONE_DIR" ]; then
rm -rf "$CLONE_DIR"
fi
git clone "$REPO_URL" "$CLONE_DIR"
echo "Applying Agent-Zero codebase to app directory..."
cp -rn "$CLONE_DIR"/* "$APP_DIR/" 2>/dev/null || true
echo "Applying patches from $PATCHES_DIR..."
if [ -d "$PATCHES_DIR/helpers" ]; then
cp -f "$PATCHES_DIR/helpers/"*.py "$APP_DIR/helpers/"
fi
if [ -d "$PATCHES_DIR/api" ]; then
mkdir -p "$APP_DIR/api"
cp -f "$PATCHES_DIR/api/"*.py "$APP_DIR/api/"
fi
echo "Installing dependencies..."
if command -v uv > /dev/null; then
uv pip install --system --no-cache -r "$APP_DIR/requirements.txt"
else
pip install --no-cache-dir -r "$APP_DIR/requirements.txt"
fi
export HF_SPACE=true
export PORT=7860
export HOST=0.0.0.0
echo "Starting Agent-Zero..."
python run_ui.py
|