Skip to content

Commit 9ba8bc9

Browse files
shoumikhinfacebook-github-bot
authored andcommitted
Update docs for the demo app. (#2921)
Summary: Pull Request resolved: #2921 overriding_review_checks_triggers_an_audit_and_retroactive_review Oncall Short Name: executorch Differential Revision: D55885790 fbshipit-source-id: bb62a42b74ecdfb2e1f6bcebab979e2e8fcf0a3c
1 parent 3e256ff commit 9ba8bc9

File tree

8 files changed

+46
-5
lines changed

8 files changed

+46
-5
lines changed
3.21 MB
Binary file not shown.
380 KB
Loading

docs/source/demo-apps-ios.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
```{include} ../../examples/demo-apps/apple_ios/README.md
1+
```{include} ../../examples/demo-apps/apple_ios/ExecuTorchDemo/README.md

docs/source/llm/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ The rest of the steps will be the same as the normal flow. Now you can run this
626626
## How to build Mobile Apps
627627
You can also execute an LLM using ExecuTorch on iOS and Android
628628

629-
**For iOS details see the [iOS Sample App](https://github.com/pytorch/executorch/tree/main/examples/demo-apps/apple_ios).**
629+
**For iOS see the [iLLaMA App](https://pytorch.org/executorch/main/llm/llama-demo-ios.html).**
630630

631631

632632
**For Android see the [Android Instructions](https://pytorch.org/executorch/main/llm/llama-demo-android.html).**

docs/source/llm/llama-demo-ios.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
```{include} ../../../examples/demo-apps/apple_ios/LLaMA/README.md
2+
```
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Building ExecuTorch LLaMA iOS Demo App
2+
3+
This app demonstrates the use of the LLaMA chat app demonstrating local inference use case with ExecuTorch.
4+
5+
<img src="../_static/img/llama_ios_app.png" alt="iOS LLaMA App" /><br>
6+
7+
## Prerequisites
8+
* [Xcode 15](https://developer.apple.com/xcode).
9+
* [iOS 17 SDK](https://developer.apple.com/ios).
10+
* Set up your ExecuTorch repo and environment if you haven’t done so by following the [Setting up ExecuTorch](https://pytorch.org/executorch/stable/getting-started-setup) to set up the repo and dev environment.
11+
12+
## Exporting models
13+
Please refer to the [ExecuTorch Llama2 docs](https://github.com/pytorch/executorch/blob/main/examples/models/llama2/README.md) to export the model.
14+
15+
## Run the App
16+
17+
1. Open the [project](https://github.com/pytorch/executorch/blob/main/examples/demo-apps/apple_ios/LLaMA/LLaMA.xcodeproj) in Xcode.
18+
2. Run the app (cmd+R).
19+
3. In app UI pick a model and tokenizer to use, type a prompt and tap the arrow buton as on the [video](../_static/img/llama_ios_app.mp4).
20+
21+
```{note}
22+
ExecuTorch runtime is distributed as a Swift package providing some .xcframework as prebuilt binary targets. Xcode will dowload and cache the package on the first run, which will take some time.
23+
```
24+
25+
## Copy the model to Simulator
26+
27+
1. Drag&drop the model and tokenizer files onto the Simulator window and save them somewhere inside the iLLaMA folder.
28+
2. Pick the files in the app dialog, type a prompt and click the arrow-up button.
29+
30+
## Copy the model to Device
31+
32+
1. Wire-connect the device and open the contents in Finder.
33+
2. Navigate to the Files tab and drag&drop the model and tokenizer files onto the iLLaMA folder.
34+
3. Wait until the files are copied.
35+
36+
## Reporting Issues
37+
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).

examples/models/llama2/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,11 +218,13 @@ adb push cmake-out-android/examples/models/llama2/llama_main /data/local/tmp/lla
218218
```
219219
adb shell "cd /data/local/tmp/llama && ./llama_main --model_path <model.pte> --tokenizer_path <tokenizer.bin> --prompt "Once upon a time" --seq_len 120
220220
```
221-
## Step 6: Build iOS and/or Android apps
221+
## Step 6: Build Mobile apps
222222
223-
TODO
223+
### iOS
224+
225+
Please refer to [this tutorial](https://pytorch.org/executorch/main/llm/llama-demo-ios.html) to for full instructions on building the iOS LLAMA Demo App.
224226
225-
### Android app
227+
### Android
226228
Please refer to [this tutorial](https://pytorch.org/executorch/main/llm/llama-demo-android.html) to for full instructions on building the Android LLAMA Demo App.
227229
228230
# What is coming next?

0 commit comments

Comments
 (0)