aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRadoslav Gerganov <rgerganov@gmail.com>2023-03-14 15:30:08 +0200
committerGitHub <noreply@github.com>2023-03-14 15:30:08 +0200
commit60f819a2b10475055a36415bc489e5b55df2d052 (patch)
tree28cdcd416c60e09bbb9db06dd3f6750004fcb7df
parent97ab2b257897bfe7e2ae72876a3e50ed41b8c7ce (diff)
Add section to README on how to run the project on Android (#130)
-rw-r--r--README.md17
-rw-r--r--models/.gitignore0
2 files changed, 17 insertions, 0 deletions
diff --git a/README.md b/README.md
index 085f19e..5d8b3b6 100644
--- a/README.md
+++ b/README.md
@@ -177,6 +177,23 @@ Note the use of `--color` to distinguish between user input and generated text.
![image](https://user-images.githubusercontent.com/1991296/224575029-2af3c7dc-5a65-4f64-a6bb-517a532aea38.png)
+### Android
+
+You can easily run `llama.cpp` on Android device with [termux](https://play.google.com/store/apps/details?id=com.termux).
+First, obtain the [Android NDK](https://developer.android.com/ndk) and then build with CMake:
+```
+$ mkdir build-android
+$ cd build-android
+$ export NDK=<your_ndk_directory>
+$ cmake -DCMAKE_TOOLCHAIN_FILE=$NDK/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=android-23 -DCMAKE_C_FLAGS=-march=armv8.4a+dotprod ..
+$ make
+```
+Install [termux](https://play.google.com/store/apps/details?id=com.termux) on your device and run `termux-setup-storage` to get access to your SD card.
+Finally, copy the `llama` binary and the model files to your device storage. Here is a demo of an interactive session running on Pixel 5 phone:
+
+https://user-images.githubusercontent.com/271616/225014776-1d567049-ad71-4ef2-b050-55b0b3b9274c.mp4
+
+
## Limitations
- We don't know yet how much the quantization affects the quality of the generated text
diff --git a/models/.gitignore b/models/.gitignore
deleted file mode 100644
index e69de29..0000000
--- a/models/.gitignore
+++ /dev/null