Files
xianren_studio/scripts/download-test-model.ps1

27 lines
806 B
PowerShell

param(
[string]$Endpoint = "https://hf-mirror.com",
[string]$OutDir = ""
)
$ErrorActionPreference = "Stop"
if (-not $OutDir) {
$OutDir = Join-Path $env:APPDATA "XianrenStudio\models"
}
New-Item -ItemType Directory -Force -Path $OutDir | Out-Null
$modelPath = "Qwen/Qwen2.5-0.5B-Instruct-GGUF/resolve/main/qwen2.5-0.5b-instruct-q4_k_m.gguf"
$url = "$Endpoint/$modelPath"
$rel = "Qwen/Qwen2.5-0.5B-Instruct-GGUF"
$targetDir = Join-Path $OutDir $rel
New-Item -ItemType Directory -Force -Path $targetDir | Out-Null
$outFile = Join-Path $targetDir "qwen2.5-0.5b-instruct-q4_k_m.gguf"
Write-Host "Downloading $url"
Write-Host "-> $outFile"
curl.exe -L --fail --progress-bar -o $outFile $url
if ($LASTEXITCODE -ne 0) {
throw "download failed with exit code $LASTEXITCODE"
}
Write-Host "Done."