23 lines
662 B
PowerShell
23 lines
662 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"
|
||
|
|
$outFile = Join-Path $OutDir "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."
|