onwx / install.ps1
ryugyosoft's picture
onwx 0.1.0: LLMs entirely on the AMD Ryzen AI NPU (XDNA2)
dc22334 verified
Raw History Blame Contribute Delete
1.8 kB
# onwx one-line installer for Windows. In PowerShell:
# irm https://huggingface.co/ryugyosoft/onwx/resolve/main/install.ps1 | iex
# Downloads onwx into %LOCALAPPDATA%\onwx (no git / hf needed) and runs setup.bat, which finds or installs Python,
# sets up the environment, adds "onwx" to the Start menu and starts the tray app. Run it again to update onwx.
$ErrorActionPreference = "Stop"
$ProgressPreference = "SilentlyContinue"
$repo = "ryugyosoft/onwx"
$dest = Join-Path $env:LOCALAPPDATA "onwx"
Write-Host ""
Write-Host "onwx - LLMs on the AMD Ryzen AI NPU"
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 }
$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 ".onwx-installed") -Value "installer" -Encoding ascii # onwx 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, onwx appears in the task tray and asks which model to download."