-
Notifications
You must be signed in to change notification settings - Fork 178
Expand file tree
/
Copy pathsetup.sh
More file actions
83 lines (72 loc) · 3.12 KB
/
Copy pathsetup.sh
File metadata and controls
83 lines (72 loc) · 3.12 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
#!/bin/bash
# Define colors for output
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
NC='\033[0m' # No Color
echo -e "${GREEN}🤖 Pi Local Assistant Setup Script${NC}"
# 1. Install System Dependencies (The "Hidden" Requirements)
echo -e "${YELLOW}[1/6] Installing System Tools (apt)...${NC}"
sudo apt update
sudo apt install -y python3-tk python3-dev libasound2-dev portaudio19-dev liblapack-dev libblas-dev cmake build-essential espeak-ng git
# 2. Create Folders
echo -e "${YELLOW}[2/6] Creating Folders...${NC}"
mkdir -p piper
mkdir -p voices # Added for custom BMO models
mkdir -p sounds/greeting_sounds
mkdir -p sounds/thinking_sounds
mkdir -p sounds/ack_sounds
mkdir -p sounds/error_sounds
mkdir -p faces/idle
mkdir -p faces/listening
mkdir -p faces/thinking
mkdir -p faces/speaking
mkdir -p faces/error
mkdir -p faces/warmup
# 3. Download Piper (Architecture Check)
echo -e "${YELLOW}[3/6] Setting up Piper TTS...${NC}"
ARCH=$(uname -m)
if [ "$ARCH" == "aarch64" ]; then
# FIXED: Using the specific 2023.11.14-2 release known to work on Pi
wget -O piper.tar.gz https://github.com/rhasspy/piper/releases/download/2023.11.14-2/piper_linux_aarch64.tar.gz
tar -xvf piper.tar.gz -C piper --strip-components=1
rm piper.tar.gz
else
echo -e "${RED}⚠️ Not on Raspberry Pi (aarch64). Skipping Piper download.${NC}"
fi
# 4. Download Voice Models
echo -e "${YELLOW}[4/6] Downloading Voice Models...${NC}"
# Download default Piper voice as fallback
cd piper
wget -nc -O en_GB-semaine-medium.onnx https://huggingface.co/rhasspy/piper-voices/resolve/v1.0.0/en/en_GB/semaine/medium/en_GB-semaine-medium.onnx
wget -nc -O en_GB-semaine-medium.onnx.json https://huggingface.co/rhasspy/piper-voices/resolve/v1.0.0/en/en_GB/semaine/medium/en_GB-semaine-medium.onnx.json
cd ..
# Download Custom BMO Voice
echo -e "${YELLOW}Downloading custom BMO voice...${NC}"
curl -L -o voices/bmo-custom.onnx "https://github.com/brenpoly/be-more-agent/releases/latest/download/bmo.onnx"
curl -L -o voices/bmo-custom.onnx.json "https://github.com/brenpoly/be-more-agent/releases/latest/download/bmo.onnx.json"
# 5. Install Python Libraries
echo -e "${YELLOW}[5/6] Installing Python Libraries...${NC}"
# Check if venv exists, if not create it
if [ ! -d "venv" ]; then
python3 -m venv venv
fi
source venv/bin/activate
pip install --upgrade pip
# Force rebuild sounddevice to link against the newly installed PortAudio dev libraries
pip install --force-reinstall --no-cache-dir sounddevice
pip install -r requirements.txt
# 6. Pull AI Models
echo -e "${YELLOW}[6/6] Checking AI Models...${NC}"
if command -v ollama &> /dev/null; then
ollama pull gemma3:1b
ollama pull moondream
else
echo -e "${RED}❌ Ollama not found. Please install it manually.${NC}"
fi
# 7. OpenWakeWord Model (Added this back so the user has a default)
if [ ! -f "wakeword.onnx" ]; then
echo -e "${YELLOW}Downloading default 'Hey Jarvis' wake word...${NC}"
curl -L -o wakeword.onnx https://github.com/dscripka/openWakeWord/raw/main/openwakeword/resources/models/hey_jarvis_v0.1.onnx
fi
echo -e "${GREEN}✨ Setup Complete! Run 'source venv/bin/activate' then 'python agent.py'${NC}"