Files
stitch/scripts/fetch-needle.sh
thekhalidsha 917d4632c2 Open source under Apache 2.0, with a new README
- LICENSE (Apache 2.0), NOTICE with credits (Needle 2, LiteRT-LM, Thinai),
  LICENSES/Thinai-MIT.txt, SPDX headers on every source file
- CONTRIBUTING (fork, branch from develop, PR into develop, maintainer
  merges), CODE_OF_CONDUCT (Contributor Covenant 2.1), SECURITY, Gitea
  issue and pull-request templates
- README rewritten with screenshots; the detailed guide moved to
  docs/USER_GUIDE.md
- Personal details removed: made-up contact names in examples and tests,
  a placeholder for the Tailscale address, made-up web-search fixtures
  in place of saved third-party pages
- B-43: the emulator reports Needle as unavailable instead of "init failed"
- B-44: chat previews show plain text, not Markdown symbols
2026-09-28 12:40:28 +05:30

15 lines
717 B
Bash
Executable File

#!/usr/bin/env bash
# SPDX-FileCopyrightText: 2026 Mohammed Khalid
# SPDX-License-Identifier: Apache-2.0
# 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."