-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_env.sh
More file actions
executable file
·90 lines (71 loc) · 2.44 KB
/
setup_env.sh
File metadata and controls
executable file
·90 lines (71 loc) · 2.44 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/bin/bash
# Setup script for EchoForge using uv
set -e # Exit immediately if a command exits with a non-zero status
# Setup colors for output
GREEN='\033[0;32m'
RED='\033[0;31m'
YELLOW='\033[0;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
# Print header
echo -e "${BLUE}=================================${NC}"
echo -e "${BLUE} EchoForge Environment Setup ${NC}"
echo -e "${BLUE}=================================${NC}"
# Get script directory
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
cd "$SCRIPT_DIR"
# Check if uv is installed
if ! command -v uv &> /dev/null; then
echo -e "${YELLOW}uv is not installed. Installing...${NC}"
curl -LsSf https://astral.sh/uv/install.sh | sh
# Add uv to PATH for this session
export PATH="$HOME/.cargo/bin:$PATH"
echo -e "${GREEN}uv installed successfully!${NC}"
fi
# Create virtual environment
echo -e "${YELLOW}Creating virtual environment...${NC}"
uv venv
# Activate virtual environment
echo -e "${YELLOW}Activating virtual environment...${NC}"
source .venv/bin/activate
# Install dependencies using uv sync
echo -e "${YELLOW}Installing dependencies using uv sync...${NC}"
uv sync
# Install development dependencies if they exist
if [ -f "requirements-dev.txt" ]; then
echo -e "${YELLOW}Installing development dependencies...${NC}"
uv pip install -r requirements-dev.txt
fi
# Create .env.local file if it doesn't exist
if [ ! -f ".env.local" ]; then
echo -e "${YELLOW}Creating .env.local file...${NC}"
cat > .env.local << EOF
# Local environment settings for EchoForge
# These settings override the defaults in config.py
# Server settings
ALLOW_PUBLIC_SERVING=true
PUBLIC_HOST=0.0.0.0
# Theme settings
DEFAULT_THEME=dark
# Authentication settings
# Uncomment and set these if you want to enable authentication
# ENABLE_AUTH=true
# AUTH_USERNAME=your_username
# AUTH_PASSWORD=your_secure_password
# Output directory
# OUTPUT_DIR=/path/to/your/output/directory
# Model settings
# MODEL_PATH=/path/to/your/model/checkpoint
EOF
echo -e "${GREEN}.env.local file created. Edit it to customize your environment.${NC}"
else
echo -e "${GREEN}.env.local file already exists.${NC}"
fi
# Create outputs directory
mkdir -p outputs
echo -e "${GREEN}Environment setup complete!${NC}"
echo -e "${YELLOW}To activate the environment, run:${NC}"
echo -e " source .venv/bin/activate"
echo
echo -e "${YELLOW}To start the server, run:${NC}"
echo -e " ./run_server.sh"