-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathfetch_models.ps1
More file actions
69 lines (61 loc) · 2.11 KB
/
Copy pathfetch_models.ps1
File metadata and controls
69 lines (61 loc) · 2.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Copyright 2025-current Getnamo.
#
# Downloads embedding models used by the LlamaTools RAG automation tests.
# Default target: bge-small-en-v1.5 Q4_K_M (~33 MB, dim 384).
#
# Usage (from any directory):
# pwsh -ExecutionPolicy Bypass -File fetch_models.ps1
# pwsh -ExecutionPolicy Bypass -File fetch_models.ps1 -All
#
# Models are placed under <project>/Saved/Models/ — the same root used by
# FLLMModelParams.PathToModel when prefixed with `./`.
param(
[switch]$All,
[string]$DestRoot
)
$ErrorActionPreference = 'Stop'
if (-not $DestRoot) {
# Walk up from this script: Plugins/Llama-Unreal/Source/LlamaTools/Private/Tests/ -> project root
$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
$ProjectRoot = (Resolve-Path (Join-Path $ScriptDir '..\..\..\..\..\..\..')).Path
$DestRoot = Join-Path $ProjectRoot 'Saved\Models'
}
New-Item -ItemType Directory -Force -Path $DestRoot | Out-Null
$Models = @(
@{
Name = 'bge-small-en-v1.5-q4_k_m.gguf'
Url = 'https://huggingface.co/CompendiumLabs/bge-small-en-v1.5-gguf/resolve/main/bge-small-en-v1.5-q4_k_m.gguf'
Size = 33MB
Required = $true
}
)
if ($All) {
$Models += @(
@{
Name = 'nomic-embed-text-v1.5.Q4_K_M.gguf'
Url = 'https://huggingface.co/nomic-ai/nomic-embed-text-v1.5-GGUF/resolve/main/nomic-embed-text-v1.5.Q4_K_M.gguf'
Size = 85MB
Required = $false
}
)
}
foreach ($M in $Models) {
$Dest = Join-Path $DestRoot $M.Name
if (Test-Path $Dest) {
Write-Host "[skip] $($M.Name) already at $Dest"
continue
}
Write-Host "[get ] $($M.Name) -> $Dest"
try {
Invoke-WebRequest -Uri $M.Url -OutFile $Dest -UseBasicParsing
} catch {
if ($M.Required) {
Write-Error "Failed to download required model $($M.Name): $($_.Exception.Message)"
throw
}
Write-Warning "Optional model $($M.Name) skipped: $($_.Exception.Message)"
}
}
Write-Host ""
Write-Host "Models ready at: $DestRoot"
Write-Host "In FLLMModelParams.PathToModel use './<filename>' to reference them."