-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
Β·46 lines (38 loc) Β· 1.31 KB
/
setup.sh
File metadata and controls
executable file
Β·46 lines (38 loc) Β· 1.31 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
#!/bin/bash
echo "=== Character Generator Setup ==="
# Load environment variables from .env file
if [ -f .env ]; then
echo "π Loading environment variables from .env..."
set -a # Automatically export all variables
source .env
set +a
else
echo "β οΈ No .env file found, proceeding without it..."
fi
# Create necessary directories
echo "π Creating necessary directories..."
mkdir -p models/{checkpoints,clip}
mkdir -p storage/{base_characters,lora_models,outputs,db}
mkdir -p packages
# Download models if they don't exist
if [ ! -f "models/checkpoints/sd_xl_base_1.0.safetensors" ]; then
echo "π₯ Downloading required models..."
python3 scripts/download_models_prereq.py
fi
# Check if Llama 3 model exists in Ollama
echo "π Checking for Llama 3 model in Ollama..."
if ! docker exec ollama ollama list | grep -q "llama3"; then
echo "π₯ Pulling Llama 3 model for Ollama..."
docker exec ollama ollama pull llama3
else
echo "β
Llama 3 model already exists in Ollama."
fi
# Download packages if they don't exist
if [ ! -d "packages/torch" ]; then
echo "π₯ Downloading required packages..."
bash scripts/download_packages.sh
fi
# Build and start Docker container
echo "π³ Building and starting Docker container..."
docker compose up --build -d
echo "β
Setup complete!"