You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Description
Removed every possible use of title case and fixed some typos / weird
usages of words
### Type of change
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [x] Documentation update (improves or adds clarity to existing
documentation)
### Tested on
- [ ] iOS
- [ ] Android
### Testing instructions
<!-- Provide step-by-step instructions on how to test your changes.
Include setup details if necessary. -->
### Screenshots
<!-- Add screenshots here, if applicable -->
### Related issues
<!-- Link related issues here using #issue-number -->
### Checklist
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have updated the documentation accordingly
- [ ] My changes generate no new warnings
### Additional notes
<!-- Include any additional information, assumptions, or context that
reviewers might need to understand this PR. -->
Copy file name to clipboardexpand all lines: docs/docs/computer-vision/useClassification.mdx
+2-2
Original file line number
Diff line number
Diff line change
@@ -61,9 +61,9 @@ A string that specifies the location of the model binary. For more information,
61
61
62
62
## Running the model
63
63
64
-
To run the model, you can use the `forward` method. It accepts one argument, which is the image. The image can be a remote URL, a local file URI, or a base64-encoded image. The function returns a promise, which can resolve either to error or an object containing categories with their probabilities.
64
+
To run the model, you can use the `forward` method. It accepts one argument, which is the image. The image can be a remote URL, a local file URI, or a base64-encoded image. The function returns a promise, which can resolve either to an error or an object containing categories with their probabilities.
65
65
66
-
:::info[Info]
66
+
:::info
67
67
Images from external sources are stored in your application's temporary directory.
Copy file name to clipboardexpand all lines: docs/docs/computer-vision/useStyleTransfer.mdx
+2-2
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,7 @@ A string that specifies the location of the model binary. For more information,
60
60
61
61
## Running the model
62
62
63
-
To run the model, you can use `forward` method. It accepts one argument, which is the image. The image can be a remote URL, a local file URI, or a base64-encoded image. The function returns a promise which can resolve either to error or a URL to generated image.
63
+
To run the model, you can use `forward` method. It accepts one argument, which is the image. The image can be a remote URL, a local file URI, or a base64-encoded image. The function returns a promise which can resolve either to an error or a URL to generated image.
64
64
65
65
:::info
66
66
Images from external sources and the generated image are stored in your application's temporary directory.
Copy file name to clipboardexpand all lines: docs/docs/fundamentals/getting-started.mdx
+1-1
Original file line number
Diff line number
Diff line change
@@ -50,7 +50,7 @@ When using Expo, please note that you need to use a custom development build of
50
50
:::
51
51
52
52
:::info
53
-
Because we are using ExecuTorch under the hood, you won't be able to build ios app for release with simulator selected as the target device. Make sure to test release builds on real devices.
53
+
Because we are using ExecuTorch under the hood, you won't be able to build iOS app for release with simulator selected as the target device. Make sure to test release builds on real devices.
Copy file name to clipboardexpand all lines: docs/docs/llms/exporting-llama.mdx
+6-6
Original file line number
Diff line number
Diff line change
@@ -6,10 +6,10 @@ sidebar_position: 2
6
6
In order to make the process of export as simple as possible for you, we created a script that runs a Docker container and exports the model.
7
7
8
8
## Steps to export Llama
9
-
### 1. Create an Account
9
+
### 1. Create an account
10
10
Get a [HuggingFace](https://huggingface.co/) account. This will allow you to download needed files. You can also use the [official Llama website](https://www.llama.com/llama-downloads/).
11
11
12
-
### 2. Select a Model
12
+
### 2. Select a model
13
13
Pick the model that suits your needs. Before you download it, you'll need to accept a license. For best performance, we recommend using Spin-Quant or QLoRA versions of the model:
The script will pull a Docker image from docker hub, and then run it to export the model. By default the output (llama3_2.pte file) will be saved in the `llama-export/outputs` directory. However, you can override that behavior with the `--output-path [path]` flag.
36
+
The script will pull a Docker image from Docker Hub, and then run it to export the model. By default the output (llama3_2.pte file) will be saved in the `llama-export/outputs` directory. However, you can override that behavior with the `--output-path [path]` flag.
37
37
38
38
:::note[Note]
39
39
This Docker image was tested on MacOS with ARM chip. This might not work in other environments.
Copy file name to clipboardexpand all lines: docs/docs/llms/running-llms.md
+4-4
Original file line number
Diff line number
Diff line change
@@ -5,8 +5,8 @@ sidebar_position: 1
5
5
6
6
React Native ExecuTorch supports Llama 3.2 models, including quantized versions. Before getting started, you’ll need to obtain the .pte binary—a serialized model—and the tokenizer. There are various ways to accomplish this:
7
7
8
-
- For your convienience, it's best if you use models exported by us, you can get them from our hugging face repository. You can also use [constants](https://github.com/software-mansion/react-native-executorch/tree/main/src/constants/modelUrls.ts) shipped with our library.
9
-
- If you want to export model by yourself,you can use a Docker image that we've prepared. To see how it works, check out [exporting Llama](./exporting-llama)
8
+
- For your convienience, it's best if you use models exported by us, you can get them from our [HuggingFace repository](https://huggingface.co/software-mansion/react-native-executorch-llama-3.2). You can also use [constants](https://github.com/software-mansion/react-native-executorch/tree/main/src/constants/modelUrls.ts) shipped with our library.
9
+
- If you want to export model by yourself,you can use a Docker image that we've prepared. To see how it works, check out [exporting Llama](./exporting-llama)
10
10
- Follow the official [tutorial](https://github.com/pytorch/executorch/blob/fe20be98c/examples/demo-apps/android/LlamaDemo/docs/delegates/xnnpack_README.md) made by ExecuTorch team to build the model and tokenizer yourself
11
11
12
12
## Initializing
@@ -55,7 +55,7 @@ Given computational constraints, our architecture is designed to support only on
55
55
|`isReady`|`boolean`| Indicates whether the model is ready |
56
56
|`downloadProgress`|`number`| Represents the download progress as a value between 0 and 1, indicating the extent of the model file retrieval. |
57
57
58
-
###Sending a message
58
+
## Sending a message
59
59
60
60
In order to send a message to the model, one can use the following code:
61
61
@@ -71,7 +71,7 @@ await llama.generate(message);
71
71
...
72
72
```
73
73
74
-
###Listening for the response
74
+
## Listening for the response
75
75
76
76
As you might've noticed, there is no return value from the `runInference` function. Instead, the `.response` field of the model is updated with each token.
77
77
This is how you can render the response of the model:
Copy file name to clipboardexpand all lines: docs/docs/module-api/executorch-bindings.md
+5-5
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@ The `modelSource` parameter expects a location string pointing to the model bina
38
38
|`loadForward`|`() => Promise<void>`| Loads resources specific to `forward` method into memory before execution. Uses `loadMethod` under the hood. |
39
39
|`forward`|`(input: ETInput, shape: number[]) => Promise<number[][]>`| Executes the model's forward pass, where `input` is a Javascript typed array and `shape` is an array of integers representing input Tensor shape. The output is a Tensor - raw result of inference. |
40
40
41
-
###ETInput
41
+
## ETInput
42
42
43
43
The `ETInput` type defines the typed arrays that can be used as inputs in the `forward` method:
44
44
@@ -48,7 +48,7 @@ The `ETInput` type defines the typed arrays that can be used as inputs in the `f
48
48
- Float32Array
49
49
- Float64Array
50
50
51
-
###Errors
51
+
## Errors
52
52
53
53
All functions provided by the `useExecutorchModule` hook are asynchronous and may throw an error. The `ETError` enum includes errors [defined by the ExecuTorch team](https://github.com/pytorch/executorch/blob/main/runtime/core/error.h) and additional errors specified by our library.
54
54
@@ -60,7 +60,7 @@ To run model with ExecuTorch Bindings it's essential to specify the shape of the
60
60
61
61
This example demonstrates the integration and usage of the ExecuTorch bindings with a [style transfer model](../computer-vision/useStyleTransfer.mdx). Specifically, we'll be using the `STYLE_TRANSFER_CANDY` model, which applies artistic style transfer to an input image.
62
62
63
-
###Importing the Module and loading the model
63
+
## Importing the Module and loading the model
64
64
65
65
First, import the necessary functions from the `react-native-executorch` package and initialize the ExecuTorch module with the specified style transfer model.
To prepare the input for the model, define the shape of the input tensor. This shape depends on the model's requirements. For the `STYLE_TRANSFER_CANDY` model, we need a tensor of shape `[1, 3, 640, 640]`, corresponding to a batch size of 1, 3 color channels (RGB), and dimensions of 640x640 pixels.
83
83
@@ -88,7 +88,7 @@ const shape = [1, 3, 640, 640];
88
88
const input =newFloat32Array(1*3*640*640); // fill this array with your image data
0 commit comments