-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup-llama.ps1
More file actions
43 lines (37 loc) · 1.4 KB
/
Copy pathsetup-llama.ps1
File metadata and controls
43 lines (37 loc) · 1.4 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
# Clone llama.cpp into mabu-android/app/src/main/cpp/llama.cpp/. The full
# llama.cpp source is too big to vendor in this repo (~185 MB even shallow
# cloned), so it's gitignored. Run this once after a fresh clone.
#
# Pin to a known-good commit if upstream churn breaks the build -- pass
# a commit / tag via -Ref.
[CmdletBinding()]
param(
# Pinned to the commit just before f08f20a0e ("ggml-cpu: fuse RMS_NORM
# + MUL on CPU backend"), which assertion-aborts on armv7 inference
# with `scale > 0.0f` failed. Once upstream fixes the fusion for armv7
# we can move the pin forward or drop it.
[string] $Ref = "07eaf919e"
)
$ErrorActionPreference = 'Stop'
$dest = 'mabu-android/app/src/main/cpp/llama.cpp'
if (Test-Path $dest) {
Write-Host "llama.cpp already exists at $dest. Skipping clone."
} else {
Write-Host "Cloning llama.cpp into $dest..."
git clone --depth 1 https://github.com/ggerganov/llama.cpp.git $dest
}
if ($Ref) {
Write-Host "Checking out $Ref"
Push-Location $dest
git fetch --depth 1 origin $Ref
git checkout $Ref
Pop-Location
}
Push-Location $dest
$commit = git log -1 --format='%h %ai %s'
Pop-Location
Write-Host "llama.cpp at: $commit"
Write-Host ""
Write-Host "Next: download a model (Qwen2.5-0.5B-Instruct Q4_K_M recommended) and adb push"
Write-Host " it to the device at /data/local/tmp/qwen.gguf"
Write-Host " (or the Mabu app's external files dir)."