33 lines
1.2 KiB
PowerShell
33 lines
1.2 KiB
PowerShell
# Скачивает Qwen2.5-1.5B-Instruct GGUF в WESP_ASSISTANT_DIR\models\
|
|
# Требуется: pip install -U huggingface_hub
|
|
#
|
|
# powershell -ExecutionPolicy Bypass -File install/assistant/download_model.ps1
|
|
|
|
$ErrorActionPreference = "Stop"
|
|
$repoRoot = (Resolve-Path (Join-Path $PSScriptRoot "..\..")).Path
|
|
if (-not $env:WESP_ASSISTANT_DIR -or [string]::IsNullOrWhiteSpace($env:WESP_ASSISTANT_DIR)) {
|
|
$root = Join-Path $repoRoot "data\assistant"
|
|
} else {
|
|
$root = $env:WESP_ASSISTANT_DIR
|
|
}
|
|
$file = if ($env:WESP_LLM_GGUF_FILE) { $env:WESP_LLM_GGUF_FILE } else { "qwen2.5-1.5b-instruct-q5_k_m.gguf" }
|
|
$dest = Join-Path $root "models"
|
|
New-Item -ItemType Directory -Force -Path $dest | Out-Null
|
|
|
|
$env:HF_DEST = $dest
|
|
$env:HF_FILE = $file
|
|
python -c @"
|
|
import os, sys
|
|
from pathlib import Path
|
|
dest = Path(os.environ['HF_DEST'])
|
|
file = os.environ['HF_FILE']
|
|
repo = 'Qwen/Qwen2.5-1.5B-Instruct-GGUF'
|
|
try:
|
|
from huggingface_hub import hf_hub_download
|
|
except ImportError:
|
|
sys.exit('Установите: pip install -U huggingface_hub')
|
|
path = hf_hub_download(repo_id=repo, filename=file, local_dir=str(dest))
|
|
print('OK:', path)
|
|
"@
|
|
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
|