-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·58 lines (49 loc) · 1.83 KB
/
Copy pathrun.sh
File metadata and controls
executable file
·58 lines (49 loc) · 1.83 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
#!/bin/bash
set -e
cd "$(dirname "$0")"
# Check dependencies
command -v ffmpeg >/dev/null 2>&1 || { echo "ERROR: ffmpeg not found. Install with: brew install ffmpeg"; exit 1; }
# Check for .env file with at least one API key
if [ -f ".env" ]; then
# Source .env to check keys (ignore comments and empty lines)
HAS_KEY=false
while IFS= read -r line; do
case "$line" in
OPENAI_API_KEY=*|GEMINI_API_KEY=*|ANTHROPIC_API_KEY=*)
val="${line#*=}"
if [ -n "$val" ] && [ "$val" != "sk-your-key-here" ] && [ "$val" != "your-gemini-key-here" ] && [ "$val" != "your-anthropic-key-here" ]; then
HAS_KEY=true
fi
;;
esac
done < .env
if [ "$HAS_KEY" = false ]; then
echo "WARNING: No API key found in .env"
echo " Transcription will work, but AI features (summaries, quizzes, Q&A) need a key."
echo " Run: cp .env.example .env and add your key."
echo ""
fi
else
echo "WARNING: No .env file found."
echo " Run: cp .env.example .env and add at least one API key."
echo ""
fi
# Create venv if needed
if [ ! -d "venv" ]; then
echo "Creating virtual environment..."
python3 -m venv venv
fi
source venv/bin/activate
# Install deps
echo "Installing dependencies..."
pip install -q -r requirements.txt
# Install mlx-whisper on Apple Silicon Macs for GPU-accelerated transcription
if [ "$(uname)" = "Darwin" ] && [ "$(uname -m)" = "arm64" ]; then
pip install -q mlx-whisper 2>/dev/null && echo " Installed mlx-whisper (Apple Silicon GPU acceleration)" || true
fi
echo ""
echo "========================================="
echo " StudyLens running on http://localhost:8000"
echo "========================================="
echo ""
uvicorn backend.main:app --host 0.0.0.0 --port 8000 --reload