-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall-win.ps1
More file actions
104 lines (94 loc) · 3.63 KB
/
Copy pathinstall-win.ps1
File metadata and controls
104 lines (94 loc) · 3.63 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
97
98
99
100
101
102
103
104
# Resonance -- Windows Install Script
# https://resonance-layer.com
# Run with: irm https://install.resonance-layer.com/install-win.ps1 | iex
$ErrorActionPreference = "Stop"
Write-Host ""
Write-Host "+----------------------------------------------------------+"
Write-Host "| Resonance -- Emotional Memory for AI |"
Write-Host "+----------------------------------------------------------+"
Write-Host ""
Write-Host "Installing Resonance on Windows..."
Write-Host ""
try {
$pythonVersion = python --version 2>&1
if ($pythonVersion -match "Python 3\.(\d+)") {
$minorVersion = [int]$matches[1]
if ($minorVersion -lt 10) {
Write-Host "ERROR: Python 3.10 or higher is required."
Write-Host " Download the latest from: https://www.python.org/downloads/"
exit 1
}
}
Write-Host "OK: $pythonVersion found"
} catch {
Write-Host "ERROR: Python is required but not installed."
Write-Host " Download it from: https://www.python.org/downloads/"
Write-Host " Make sure to check 'Add Python to PATH' during install."
exit 1
}
$venvDir = "$HOME\resonance"
Write-Host "Creating virtual environment at $venvDir..."
python -m venv $venvDir
Write-Host "OK: Virtual environment created"
Write-Host ""
Write-Host "Installing resonance-layer..."
Write-Host ""
$job = Start-Job -ScriptBlock {
param($venvDir)
& "$venvDir\Scripts\pip" install --quiet --disable-pip-version-check --upgrade resonance-layer 2>&1
} -ArgumentList $venvDir
$width = 40
$filled = 0
$lastPct = -1
$startTime = Get-Date
while ($job.State -eq 'Running') {
$elapsed = ((Get-Date) - $startTime).TotalSeconds
if ($elapsed -lt 10) { $target = [int]($elapsed * 2) }
elseif ($elapsed -lt 30) { $target = 20 + [int](($elapsed - 10) * 0.5) }
elseif ($elapsed -lt 120) { $target = 30 + [int](($elapsed - 30) * 0.09) }
else { $target = 38 }
if ($target -gt 38) { $target = 38 }
if ($filled -lt $target) { $filled++ }
$pct = [int](($filled / $width) * 100)
if ($pct -ne $lastPct) {
$bar = ("#" * $filled) + ("-" * ($width - $filled))
Write-Host -NoNewline "`r [$bar] $pct% "
$lastPct = $pct
}
Start-Sleep -Milliseconds 500
}
Receive-Job $job | Out-Null
Remove-Job $job
$bar = "#" * $width
Write-Host "`r [$bar] 100% "
Write-Host ""
Write-Host "OK: Resonance installed"
Write-Host ""
Write-Host "Downloading model weights (first run only, ~700MB)..."
Write-Host "This may take a few minutes depending on your connection."
Write-Host ""
& "$venvDir\Scripts\python" -c @"
import os, json
config_dir = os.path.expanduser('~/.resonance')
os.makedirs(config_dir, exist_ok=True)
config_path = os.path.join(config_dir, 'config.json')
if not os.path.exists(config_path):
with open(config_path, 'w') as f:
json.dump({'first_run_complete': True, 'feedback_enabled': False}, f)
from resonance.model_loader import ensure_model_downloaded
ensure_model_downloaded()
"@
Write-Host ""
Write-Host "+----------------------------------------------------------+"
Write-Host "| Resonance is ready. |"
Write-Host "+----------------------------------------------------------+"
Write-Host ""
Write-Host "Add it to any Python project:"
Write-Host " from resonance import Resonance"
Write-Host " r = Resonance(user_id='your-user-id')"
Write-Host ""
Write-Host "To enable anonymous feedback to help improve Resonance:"
Write-Host " r.set_feedback(True)"
Write-Host ""
Write-Host "Developer guide: https://resonance-layer.com/guide"
Write-Host ""