Files
stitch/scripts/fetch-needle.sh
thekhalidsha 61409cb444 Initial import: Stitch 0.4.3 (versionCode 16)
The project's first commit, six days and 16 releases after it started. Everything
up to this point existed only as files on one machine, with no history and no undo.

Contents: single Gradle module, 62 Kotlin files (11,244 lines) and the Needle 2 JNI
bridge, 70 tools, 87 passing unit tests, and the five documents in docs/ plus
DEVELOPMENT_HISTORY.md and README.md.

Not tracked: build outputs (build/, .cxx/, .gradle/), the release APKs in dist/
(~800 MB, rebuildable), local.properties, and .claude/settings.local.json — all
machine-specific. The prebuilt libneedle.a files (38 MB) *are* tracked on purpose,
so a checkout builds without depending on Hugging Face still serving them.
2026-09-25 14:23:14 +05:30

13 lines
632 B
Bash
Executable File

#!/usr/bin/env bash
# Downloads the prebuilt Needle 2 engine (Android arm64 + armv7; the model is built into libneedle.a).
# https://huggingface.co/Cactus-Compute/needle2 (Apache-2.0)
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
BASE="https://huggingface.co/Cactus-Compute/needle2/resolve/main"
CPP="$ROOT/app/src/main/cpp/needle"
mkdir -p "$CPP/arm64-v8a" "$CPP/armeabi-v7a"
curl -fsSL -o "$CPP/needle.h" "$BASE/android-arm64/needle.h"
curl -fsSL -o "$CPP/arm64-v8a/libneedle.a" "$BASE/android-arm64/libneedle.a"
curl -fsSL -o "$CPP/armeabi-v7a/libneedle.a" "$BASE/android-armv7/libneedle.a"
echo "Needle 2 fetched."