Skip to content

Commit

Permalink
Update to use ET prebuilt Android library on 20240719 (pytorch#929)
Browse files Browse the repository at this point in the history
* Update to use ET prebuilt Android library on 20240719

* Use rc3 and fix android build
  • Loading branch information
kirklandsign authored Jul 19, 2024
1 parent 2853f4b commit 53344db
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -348,20 +348,20 @@ Currently the tokenizer is built at compile time, so you need to re-build the ap
> [!NOTE]
> The script to build the AAR can be found [here](https://github.com/pytorch/executorch/blob/main/build/build_android_library.sh). If you need to tweak with the tokenizer or runtime (for example use your own tokenizer or runtime library), you can modify the ExecuTorch code and use that script to build the AAR library.
[executorch-llama-torchchat-bpe.aar](https://ossci-android.s3.amazonaws.com/executorch/release/0.3/executorch-llama-bpe-rc1.aar) (SHASUM: 673af4a1338a93d47369b68ec0d52b8ea7f983a2)
[executorch-llama-bpe-rc3-0719.aar](https://ossci-android.s3.amazonaws.com/executorch/main/executorch-llama-bpe-rc3-0719.aar) (SHASUM: d5fe81d9a4700c36b50ae322e6bf34882134edb0)
[executorch-llama-torchchat-tiktoken.aar](https://ossci-android.s3.amazonaws.com/executorch/release/0.3/executorch-llama-tiktoken-rc1.aar) (SHASUM: 575190205dbb1ee932a277b50520dc4260a9a9cf)
[executorch-llama-tiktoken-rc3-0719.aar](https://ossci-android.s3.amazonaws.com/executorch/main/executorch-llama-tiktoken-rc3-0719.aar) (SHASUM: c3e5d2a97708f033c2b1839a89f12f737e3bbbef)
For BPE tokenizer:
```
curl https://ossci-android.s3.amazonaws.com/executorch/release/0.3/executorch-llama-bpe-rc1.aar -o android/Torchchat/app/libs/executorch.aar --create-dirs
echo "673af4a1338a93d47369b68ec0d52b8ea7f983a2 android/Torchchat/app/libs/executorch.aar" | shasum --check
curl https://ossci-android.s3.amazonaws.com/executorch/main/executorch-llama-bpe-rc3-0719.aar -o android/Torchchat/app/libs/executorch.aar --create-dirs
echo "d5fe81d9a4700c36b50ae322e6bf34882134edb0 android/Torchchat/app/libs/executorch.aar" | shasum --check
```
For tiktoken tokenizer:
```
curl https://ossci-android.s3.amazonaws.com/executorch/release/0.3/executorch-llama-tiktoken-rc1.aar -o android/Torchchat/app/libs/executorch.aar --create-dirs
echo "575190205dbb1ee932a277b50520dc4260a9a9cf android/Torchchat/app/libs/executorch.aar" | shasum --check
curl https://ossci-android.s3.amazonaws.com/executorch/main/executorch-llama-tiktoken-rc3-0719.aar -o android/Torchchat/app/libs/executorch.aar --create-dirs
echo "c3e5d2a97708f033c2b1839a89f12f737e3bbbef android/Torchchat/app/libs/executorch.aar" | shasum --check
```
You also need to push the model and tokenizer file to your device. Please refer to the docs above on generating the pte and bin file, or use E2E script (see section below) to generate and push the file.
Expand Down
2 changes: 1 addition & 1 deletion android/Torchchat/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) Meta Platforms, Inc. and affiliates.
All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
-->
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

Expand Down
10 changes: 5 additions & 5 deletions scripts/android_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ else
fi

if [ "${USE_TIKTOKEN:-OFF}" == "ON" ]; then
LLAMA_AAR_URL="https://ossci-android.s3.amazonaws.com/executorch/release/0.3/executorch-llama-tiktoken-rc1.aar"
LLAMA_AAR_SHASUM="575190205dbb1ee932a277b50520dc4260a9a9cf"
LLAMA_AAR_URL="https://ossci-android.s3.amazonaws.com/executorch/main/executorch-llama-tiktoken-rc3-0719.aar"
LLAMA_AAR_SHASUM="c3e5d2a97708f033c2b1839a89f12f737e3bbbef"
else
LLAMA_AAR_URL="https://ossci-android.s3.amazonaws.com/executorch/release/0.3/executorch-llama-bpe-rc1.aar"
LLAMA_AAR_SHASUM="673af4a1338a93d47369b68ec0d52b8ea7f983a2"
LLAMA_AAR_URL="https://ossci-android.s3.amazonaws.com/executorch/main/executorch-llama-bpe-rc3-0719.aar"
LLAMA_AAR_SHASUM="d5fe81d9a4700c36b50ae322e6bf34882134edb0"
fi

mkdir -p ${TORCHCHAT_ROOT}/build/android
Expand Down Expand Up @@ -162,4 +162,4 @@ adb install -t android/Torchchat/app/build/outputs/apk/debug/app-debug.apk

if [ -z "${CI_ENV:-}" ]; then
read -p "Press enter to exit emulator and finish"
else
fi

0 comments on commit 53344db

Please sign in to comment.