Skip to content

Add checksum in Android prebuilt #485

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions scripts/android_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ LLAMA_JNI_ARM64_URL="https://ossci-android.s3.us-west-1.amazonaws.com/executorch
LLAMA_JNI_X86_64_URL="https://ossci-android.s3.us-west-1.amazonaws.com/executorch/release/0.2/x86_64/libexecutorch_llama_jni.so"
LLAMA_JAR_URL="https://ossci-android.s3.us-west-1.amazonaws.com/executorch/release/0.2/executorch.jar"

LLAMA_JNI_ARM64_SHASUM="38788e2a3318075ccdd6e337e4c56f82bbbce06f"
LLAMA_JNI_X86_64_SHASUM="cdc98d468b8e48c8784408fcada8177e6bc5f981"
LLAMA_JAR_SHASUM="fb9ee00d028ef23a48cb8958638a5010ba849ccf"

mkdir -p ${TORCHCHAT_ROOT}/build/android

setup_java() {
Expand Down Expand Up @@ -78,16 +82,19 @@ setup_android_ndk() {
download_jar_library() {
mkdir -p ${TORCHCHAT_ROOT}/build/android
curl "${LLAMA_JAR_URL}" -o ${TORCHCHAT_ROOT}/build/android/executorch.jar
echo "${LLAMA_JAR_SHASUM} ${TORCHCHAT_ROOT}/build/android/executorch.jar" | shasum --check --status
}

download_jni_library() {
mkdir -p ${TORCHCHAT_ROOT}/build/android/arm64-v8a
mkdir -p ${TORCHCHAT_ROOT}/build/android/x86_64
if [ ! -f ${TORCHCHAT_ROOT}/build/android/arm64-v8a/libexecutorch_llama_jni.so ]; then
curl "${LLAMA_JNI_ARM64_URL}" -o ${TORCHCHAT_ROOT}/build/android/arm64-v8a/libexecutorch_llama_jni.so
echo "${LLAMA_JNI_ARM64_SHASUM} ${TORCHCHAT_ROOT}/build/android/arm64-v8a/libexecutorch_llama_jni.so" | shasum --check --status
fi
if [ ! -f ${TORCHCHAT_ROOT}/build/android/x86_64/libexecutorch_llama_jni.so ]; then
curl "${LLAMA_JNI_X86_64_URL}" -o ${TORCHCHAT_ROOT}/build/android/x86_64/libexecutorch_llama_jni.so
echo "${LLAMA_JNI_X86_64_SHASUM} ${TORCHCHAT_ROOT}/build/android/x86_64/libexecutorch_llama_jni.so" | shasum --check --status
fi
}

Expand Down