Skip to content

Instantly share code, notes, and snippets.

@ethanc8
Last active May 30, 2024 22:32
Show Gist options
  • Save ethanc8/66ee3b6abf58e77943331d3a511a015e to your computer and use it in GitHub Desktop.
Save ethanc8/66ee3b6abf58e77943331d3a511a015e to your computer and use it in GitHub Desktop.
Executorch LLM tutorial

Usage of the Android Demo App

You can download the v0.2.0 APK from GitHub Actions or build it yourself from commit 6a1703e (v0.2.0 with buildfixes for Android).

  1. Download and install the APK.

On-device instructions using Shizuku and aShell

  1. Download and install Shizuku and aShell
  2. Open Shizuku, pair it with your device via wireless debugging, and start the Shizuku service.
  3. Download an Executorch model such as stories110M (you need the tokenizer.bin and the .pte file) to your download folder (which is usually /sdcard/Download)
  4. Open aShell and type:
mkdir -p /data/local/tmp/llama
cp /sdcard/Download/tokenizer.bin /data/local/tmp/llama/tokenizer.bin
cp /sdcard/Download/xnnpack_llama2.pte /data/local/tmp/llama/xnnpack_llama2.pte

(make sure to change the file paths if they're different for your device or the model you're using!) 6. Open ExecuTorchLlamaDemo

@ethanc8
Copy link
Author

ethanc8 commented May 30, 2024

Right now I'm getting the error "Load failed: 34".

I posted about this error at https://discuss.pytorch.org/t/android-demo-app-load-failed-34/203796.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment