-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlaunch.ps1
More file actions
59 lines (52 loc) Β· 1.91 KB
/
launch.ps1
File metadata and controls
59 lines (52 loc) Β· 1.91 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
# IonoI Bets Streamlit App Launcher
Write-Host "π Launching IonoI Bets Streamlit App..." -ForegroundColor Green
Write-Host ""
# Check if Python is installed
try {
$pythonVersion = python --version 2>&1
Write-Host "β
Python found: $pythonVersion" -ForegroundColor Green
} catch {
Write-Host "β Python is not installed or not in PATH" -ForegroundColor Red
Write-Host "Please install Python 3.8+ from https://python.org" -ForegroundColor Yellow
Read-Host "Press Enter to exit"
exit 1
}
# Check if requirements are installed
Write-Host "π¦ Checking dependencies..." -ForegroundColor Blue
try {
$streamlitInstalled = pip show streamlit 2>&1
if ($LASTEXITCODE -eq 0) {
Write-Host "β
Dependencies already installed" -ForegroundColor Green
} else {
throw "Streamlit not found"
}
} catch {
Write-Host "π₯ Installing dependencies..." -ForegroundColor Yellow
pip install -r requirements.txt
if ($LASTEXITCODE -ne 0) {
Write-Host "β Failed to install dependencies" -ForegroundColor Red
Read-Host "Press Enter to exit"
exit 1
}
}
# Check if config.env exists and has API key
if (-not (Test-Path "config.env")) {
Write-Host "β οΈ config.env not found. Creating template..." -ForegroundColor Yellow
@"
GEMINI_API_KEY=your_api_key_here
DEBUG=false
LOG_LEVEL=INFO
"@ | Out-File -FilePath "config.env" -Encoding UTF8
Write-Host ""
Write-Host "π Please edit config.env and add your Gemini API key" -ForegroundColor Yellow
Write-Host ""
}
# Launch the app
Write-Host "π Starting Streamlit app..." -ForegroundColor Green
Write-Host "π± The app will open in your browser" -ForegroundColor Blue
Write-Host "π Make sure to set your Gemini API key in config.env" -ForegroundColor Yellow
Write-Host ""
Write-Host "Press Ctrl+C to stop the app" -ForegroundColor Cyan
Write-Host ""
streamlit run app.py
Read-Host "Press Enter to exit"