Skip to content

Commit 8d1c4be

Browse files
committed
Fix the script
1 parent 26811d0 commit 8d1c4be

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

.github/workflows/_android.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ jobs:
3636
cp ${BUILD_AAR_DIR}/executorch.aar $ARTIFACTS_DIR_NAME
3737
3838
mkdir -p ${ARTIFACTS_DIR_NAME}/library_test_dir
39-
mkdir -p extension/android/executorch_android/src/androidTest/resources
40-
cp extension/module/test/resources/add.pte extension/android/executorch_android/src/androidTest/resources
4139
(cd extension/android; ANDROID_HOME="${ANDROID_SDK:-/opt/android/sdk}" ./gradlew :executorch_android:assembleAndroidTest)
4240
cp extension/android/executorch_android/build/outputs/apk/androidTest/debug/executorch_android-debug-androidTest.apk "${ARTIFACTS_DIR_NAME}/library_test_dir"
4341

extension/android/executorch_android/android_test_setup.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,17 @@ if [[ -z "${PYTHON_EXECUTABLE:-}" ]]; then
1212
fi
1313
which "${PYTHON_EXECUTABLE}"
1414

15-
cp ../../../extension/module/test/resources/add.pte src/androidTest/resources
15+
BASEDIR=$(dirname "$0")
16+
cp "${BASEDIR}/../../../extension/module/test/resources/add.pte" "${BASEDIR}/src/androidTest/resources"
17+
18+
pushd "${BASEDIR}/../../../"
19+
curl -Ls "https://huggingface.co/karpathy/tinyllamas/resolve/main/stories110M.pt" --output stories110M.pt
20+
curl -Ls "https://raw.githubusercontent.com/karpathy/llama2.c/master/tokenizer.model" --output tokenizer.model
21+
# Create params.json file
22+
touch params.json
23+
echo '{"dim": 768, "multiple_of": 32, "n_heads": 12, "n_layers": 12, "norm_eps": 1e-05, "vocab_size": 32000}' > params.json
24+
python -m examples.models.llama.export_llama -c stories110M.pt -p params.json -X -kv
25+
26+
cp *.pte "${BASEDIR}/src/androidTest/resources/stories.pte"
27+
cp *.bin "${BASEDIR}/src/androidTest/resources/tokenizer.bin"
28+
popd

extension/android/executorch_android/src/androidTest/java/org/pytorch/executorch/LlmModuleInstrumentationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
/** Unit tests for {@link org.pytorch.executorch.extension.llm.LlmModule}. */
4141
@RunWith(AndroidJUnit4.class)
4242
public class LlmModuleInstrumentationTest implements LlmCallback {
43-
private static String TEST_FILE_NAME = "/tinyllama_portable_fp16_h.pte";
43+
private static String TEST_FILE_NAME = "/stories.pte";
4444
private static String TOKENIZER_FILE_NAME = "/tokenizer.bin";
4545
private static String TEST_PROMPT = "Hello";
4646
private static int OK = 0x00;

0 commit comments

Comments
 (0)