Port of Andrej Karpathy's llama2.c to Android. You can run it as raw binary or use it as shared library.
You can use the prebuild binaries in libs or compile on your own:
# or wherever your ndk-build script resides
cd jni && $ANDROID_HOME/ndk-bundle/ndk-buildGet e.g. termux and install APK to run binaries.
wget https://karpathy.ai/llama2c/model.bin -P out
adb push libs/<your abi>/llama2 /storage/emulated/0/Android/data
adb push model.bin /storage/emulated/0/Android/data
adb push tokenizer.bin /storage/emulated/0/Android/dataIn Termux:
cp /storage/emulated/0/Android/llama2 .
chmod +x llama2
./llama2 model.binwip

