-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·96 lines (86 loc) · 2.34 KB
/
setup.sh
File metadata and controls
executable file
·96 lines (86 loc) · 2.34 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
91
92
93
94
95
96
#!/bin/bash
# Quick setup script for LLM Playground
set -e # Exit on error
echo "🚀 LLM Playground - Quick Setup"
echo "================================"
echo ""
# Check if Ollama is installed
echo "Checking for Ollama..."
if ! command -v ollama &> /dev/null; then
echo "❌ Ollama not found!"
echo ""
echo "Please install Ollama first:"
echo " macOS: brew install ollama"
echo " Linux: curl -fsSL https://ollama.com/install.sh | sh"
echo " Visit: https://ollama.com"
exit 1
fi
echo "✅ Ollama found"
# Check if Ollama is running
echo ""
echo "Checking if Ollama is running..."
if ! curl -s http://localhost:11434/api/tags &> /dev/null; then
echo "⚠️ Ollama not running. Starting it..."
echo "Run this in a separate terminal: ollama serve"
echo ""
read -p "Press Enter after starting Ollama..."
fi
echo "✅ Ollama is running"
# Pull a model if needed
echo ""
echo "Checking for llama2 model..."
if ollama list | grep -q llama2; then
echo "✅ llama2 found"
else
echo "⚠️ llama2 not found. Pulling it (this may take a few minutes)..."
ollama pull llama2
echo "✅ llama2 downloaded"
fi
# Create virtual environment
echo ""
echo "Creating virtual environment..."
if [ ! -d "venv" ]; then
python3 -m venv venv
echo "✅ Virtual environment created"
else
echo "✅ Virtual environment already exists"
fi
# Activate and install dependencies
echo ""
echo "Installing dependencies..."
source venv/bin/activate
pip install -q --upgrade pip
pip install -q -r requirements.txt
echo "✅ Dependencies installed"
# Create .env file
echo ""
echo "Setting up .env file..."
if [ ! -f ".env" ]; then
cp .env.example .env
echo "✅ .env file created"
else
echo "✅ .env file already exists"
fi
# Run example
echo ""
echo "================================"
echo "✅ Setup complete!"
echo "================================"
echo ""
echo "Running example to verify setup..."
echo ""
python example.py
echo ""
echo "🎉 All set! You can now:"
echo ""
echo " Start the web app:"
echo " streamlit run app.py"
echo ""
echo " Use the CLI:"
echo " python cli.py generate \"What is machine learning?\""
echo ""
echo " Read the documentation:"
echo " - README.md - Setup and overview"
echo " - CONCEPTS.md - Theory and explanations"
echo " - LEARNING_OUTCOMES.md - What you'll learn"
echo ""