onw / install.ps1
ryugyosoft's picture
onw 3.0.0: onw NPU kit (Windows and Linux) - weightless graphs, shared weights, compiler fixes; fused graphs on by default from Lunar Lake on, up to 32K positions
2a04c3c verified
Raw History Blame Contribute Delete
1.89 kB
# onw one-line installer for Windows. In PowerShell:
# irm https://huggingface.co/ryugyosoft/onw/resolve/main/install.ps1 | iex
# Downloads onw into %LOCALAPPDATA%\onw (no git / hf needed) and runs setup.bat, which finds or installs Python,
# sets up the environment, adds "onw" to the Start menu and starts the tray app. Run it again to update onw.
$ErrorActionPreference = "Stop"
$ProgressPreference = "SilentlyContinue"
$repo = "ryugyosoft/onw"
$dest = Join-Path $env:LOCALAPPDATA "onw"
Write-Host ""
Write-Host "onw - Ore no NPU ga konna ni ugoku wake nai"
Write-Host "Installing into $dest ..."
function Get-WithRetry($uri, $out) {
for ($i = 1; $i -le 4; $i++) {
try {
if ($out) { Invoke-WebRequest -UseBasicParsing -Uri $uri -OutFile $out; return }
return Invoke-RestMethod $uri
} catch {
if ($i -eq 4) { throw }
Write-Host " retrying ($($_.Exception.Message)) ..."
Start-Sleep -Seconds (2 * $i)
}
}
}
$info = Get-WithRetry "https://huggingface.co/api/models/$repo" $null
foreach ($s in $info.siblings) {
$f = $s.rfilename
if ($f -eq ".gitattributes") { continue }
if ($f.StartsWith("onw/npukit/linux/")) { continue } # (the NPU kit for Linux)
$out = Join-Path $dest ($f -replace "/", "\")
New-Item -ItemType Directory -Force -Path (Split-Path $out) | Out-Null
Get-WithRetry "https://huggingface.co/$repo/resolve/main/$f" $out
}
Set-Content -Path (Join-Path $dest ".onw-installed") -Value "installer" -Encoding ascii # onw may update itself here
Write-Host "Downloaded $($info.siblings.Count - 1) files. Starting setup (Python, packages, Start menu, tray) ..."
Start-Process -FilePath (Join-Path $dest "setup.bat") -WorkingDirectory $dest
Write-Host "A setup window opened. When it finishes, onw appears in the task tray and asks which model to download."