Spaces:
Runtime error
Runtime error
File size: 4,273 Bytes
331f4b7 | 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 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | # ReproAgent Quick Start Script for Windows
# Run with: .\run.ps1
# Enable strict mode
$ErrorActionPreference = "Stop"
Write-Host ""
Write-Host "π ReproAgent Quick Start (Windows)" -ForegroundColor Cyan
Write-Host "====================================" -ForegroundColor Cyan
Write-Host ""
# Check Python version
Write-Host "Checking Python version..." -ForegroundColor Yellow
try {
$pythonVersion = python --version 2>&1
Write-Host " $pythonVersion" -ForegroundColor Green
} catch {
Write-Host " β Python not found! Please install Python 3.10+" -ForegroundColor Red
exit 1
}
# Check if virtual environment exists
if (-Not (Test-Path "venv")) {
Write-Host ""
Write-Host "π¦ Creating virtual environment..." -ForegroundColor Yellow
python -m venv venv
Write-Host " β
Virtual environment created" -ForegroundColor Green
}
# Activate virtual environment
Write-Host ""
Write-Host "π§ Activating virtual environment..." -ForegroundColor Yellow
& .\venv\Scripts\Activate.ps1
Write-Host " β
Activated" -ForegroundColor Green
# Install dependencies
Write-Host ""
Write-Host "π₯ Installing dependencies..." -ForegroundColor Yellow
python -m pip install --upgrade pip --quiet
python -m pip install -r requirements.txt --quiet
Write-Host " β
Dependencies installed" -ForegroundColor Green
# Create .env if not exists
if (-Not (Test-Path ".env")) {
Write-Host ""
Write-Host "π Creating .env file..." -ForegroundColor Yellow
if (Test-Path ".env.example") {
Copy-Item .env.example .env
} else {
"# Add your API keys here" | Out-File -FilePath .env -Encoding UTF8
}
Write-Host " β οΈ Please edit .env and add your API keys" -ForegroundColor Yellow
Write-Host " (Optional - system works without LLM)" -ForegroundColor Gray
}
# Create data directories
Write-Host ""
Write-Host "π Setting up data directories..." -ForegroundColor Yellow
$dirs = @(
"data\papers\easy",
"data\papers\medium",
"data\papers\hard",
"logs",
"checkpoints"
)
foreach ($dir in $dirs) {
if (-Not (Test-Path $dir)) {
New-Item -ItemType Directory -Path $dir -Force | Out-Null
}
}
Write-Host " β
Directories created" -ForegroundColor Green
# Create sample data
Write-Host ""
Write-Host "π Creating sample papers..." -ForegroundColor Yellow
try {
python -c "from reproagent.papers import create_sample_papers; create_sample_papers()" 2>$null
Write-Host " β
Sample data ready" -ForegroundColor Green
} catch {
Write-Host " β οΈ Sample paper creation skipped" -ForegroundColor Yellow
}
# Validate environment
Write-Host ""
Write-Host "π Validating environment..." -ForegroundColor Yellow
$validationResult = python validate.py
if ($LASTEXITCODE -eq 0) {
Write-Host ""
Write-Host "β
Validation passed!" -ForegroundColor Green
} else {
Write-Host ""
Write-Host "β οΈ Some validations failed (may be non-critical)" -ForegroundColor Yellow
}
# Ask what to do
Write-Host ""
Write-Host ("=" * 50)
Write-Host "What would you like to do?"
Write-Host ("=" * 50)
Write-Host "1) Launch Gradio demo (recommended)"
Write-Host "2) Run inference"
Write-Host "3) Run baseline comparison"
Write-Host "4) Run validation only"
Write-Host "5) Exit"
Write-Host ""
$choice = Read-Host "Enter choice [1-5]"
switch ($choice) {
"1" {
Write-Host ""
Write-Host "π¨ Launching Gradio demo..." -ForegroundColor Cyan
python server/app.py
}
"2" {
Write-Host ""
Write-Host "π€ Running inference..." -ForegroundColor Cyan
python inference.py --difficulty easy --steps 30
}
"3" {
Write-Host ""
Write-Host "π Running baseline comparison..." -ForegroundColor Cyan
python baseline/run_baseline.py
}
"4" {
Write-Host ""
Write-Host "β
Validation complete (already ran above)" -ForegroundColor Green
}
"5" {
Write-Host "π Goodbye!" -ForegroundColor Cyan
exit 0
}
default {
Write-Host "Invalid choice. Exiting." -ForegroundColor Red
exit 1
}
}
|