Skip to content

Commit d55c131

Browse files
committed
Add xor example to Android JNI setup
Summary: In preparation for adding the Android JNI, add the xor training model to the test prep script. Test Plan: Ensure that xor_only.pte, xor.pte, and xor.ptd are generated. Check CI is successful.
1 parent 557b4de commit d55c131

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ pip-out/
2626
*.model
2727
tokenizer.json
2828
*.pte
29+
*.ptd
2930
!test_bpe_tokenizer.bin
3031
!test_tiktoken_tokenizer.model
3132

extension/android/executorch_android/android_test_setup.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ prepare_add() {
1818
python3 -m test.models.export_program --modules "ModuleAdd" --outdir "${BASEDIR}/src/androidTest/resources/"
1919
}
2020

21+
prepare_xor() {
22+
python3 -m extension.training.examples.XOR.export_model --outdir "${BASEDIR}/src/androidTest/resources/"
23+
mv "${BASEDIR}/src/androidTest/resources/xor.pte" "${BASEDIR}/src/androidTest/resources/xor_only.pte"
24+
python3 -m extension.training.examples.XOR.export_model --outdir "${BASEDIR}/src/androidTest/resources/" --external
25+
}
26+
2127
prepare_tinyllama() {
2228
pushd "${BASEDIR}/../../../"
2329
curl -C - -Ls "https://huggingface.co/karpathy/tinyllamas/resolve/main/stories15M.pt" --output stories15M.pt
@@ -43,5 +49,6 @@ prepare_vision() {
4349
}
4450

4551
prepare_add
52+
prepare_xor
4653
prepare_tinyllama
4754
prepare_vision

0 commit comments

Comments
 (0)