Skip to content

Commit 12456f7

Browse files
committed
Docs
1 parent aa7d750 commit 12456f7

File tree

1 file changed

+28
-0
lines changed
  • examples/demo-apps/android/LlamaDemo

1 file changed

+28
-0
lines changed

examples/demo-apps/android/LlamaDemo/README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,5 +141,33 @@ Ensure you have the following functions in your callback class that you provided
141141

142142
```
143143

144+
## Instrumentation Test
145+
You can run the instrumentation test for sanity check. The test loads a model pte file and tokenizer.bin file
146+
under `/data/local/tmp/llama`.
147+
148+
### Model preparation
149+
Go to ExecuTorch root,
150+
```sh
151+
curl -C - -Ls "https://huggingface.co/karpathy/tinyllamas/resolve/main/stories110M.pt" --output stories110M.pt
152+
curl -C - -Ls "https://raw.githubusercontent.com/karpathy/llama2.c/master/tokenizer.model" --output tokenizer.model
153+
# Create params.json file
154+
touch params.json
155+
echo '{"dim": 768, "multiple_of": 32, "n_heads": 12, "n_layers": 12, "norm_eps": 1e-05, "vocab_size": 32000}' > params.json
156+
python -m examples.models.llama.export_llama -c stories110M.pt -p params.json -d fp16 -n stories110m_h.pte -kv
157+
python -m pytorch_tokenizers.tools.llama2c.convert -t tokenizer.model -o tokenizer.bin
158+
```
159+
### Push model
160+
```sh
161+
adb mkdir -p /data/local/tmp/llama
162+
adb push stories110m_h.pte /data/local/tmp/llama
163+
adb push tokenizer.bin /data/local/tmp/llama
164+
```
165+
166+
### Run test
167+
Go to `examples/demo-apps/android/LlamaDemo`,
168+
```sh
169+
./gradlew connectedAndroidTest
170+
```
171+
144172
## Reporting Issues
145173
If you encountered any bugs or issues following this tutorial please file a bug/issue here on [Github](https://github.com/pytorch/executorch/issues/new).

0 commit comments

Comments
 (0)