Skip to content

Commit 98cbe68

Browse files
authored
docs: correct title casing and minor typos (#71)
## 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. -->
1 parent 2811ca9 commit 98cbe68

8 files changed

+23
-23
lines changed

docs/docs/computer-vision/useClassification.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ A string that specifies the location of the model binary. For more information,
6161

6262
## Running the model
6363

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.
6565

66-
:::info[Info]
66+
:::info
6767
Images from external sources are stored in your application's temporary directory.
6868
:::
6969

docs/docs/computer-vision/useObjectDetection.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ function App() {
120120
}
121121
```
122122

123-
## Supported Models
123+
## Supported models
124124

125125
| Model | Number of classes | Class list |
126126
| --------------------------------------------------------------------------------------------------------------- | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

docs/docs/computer-vision/useStyleTransfer.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ A string that specifies the location of the model binary. For more information,
6060

6161
## Running the model
6262

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.
6464

6565
:::info
6666
Images from external sources and the generated image are stored in your application's temporary directory.
@@ -86,7 +86,7 @@ function App(){
8686
}
8787
```
8888

89-
## Supported Models
89+
## Supported models
9090

9191
- [Candy](https://github.com/pytorch/examples/tree/main/fast_neural_style)
9292
- [Mosaic](https://github.com/pytorch/examples/tree/main/fast_neural_style)

docs/docs/fundamentals/getting-started.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ When using Expo, please note that you need to use a custom development build of
5050
:::
5151

5252
:::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.
5454
:::
5555

5656
Running the app with the library:

docs/docs/fundamentals/loading-models.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ sidebar_position: 1
55

66
There are three different methods available for loading model files, depending on their size and location.
77

8-
**1. Load from React-Native assets folder (For Files < **512MB**)**
8+
**1. Load from React Native assets folder (For Files < 512MB)**
99

1010
```typescript
1111
modelSource: require('../assets/llama3_2.pte');
1212
```
1313

14-
**2. Load from Remote URL:**
14+
**2. Load from remote URL:**
1515

1616
For files larger than 512MB or when you want to keep size of the app smaller, you can load the model from a remote URL (e.g. HuggingFace).
1717

docs/docs/llms/exporting-llama.mdx

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ sidebar_position: 2
66
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.
77

88
## Steps to export Llama
9-
### 1. Create an Account
9+
### 1. Create an account
1010
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/).
1111

12-
### 2. Select a Model
12+
### 2. Select a model
1313
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:
1414
- [Llama 3.2 3B](https://huggingface.co/meta-llama/Llama-3.2-3B-Instruct/tree/main/original)
1515
- [Llama 3.2 1B](https://huggingface.co/meta-llama/Llama-3.2-1B-Instruct/tree/main/original)
@@ -18,22 +18,22 @@ Pick the model that suits your needs. Before you download it, you'll need to acc
1818
- [Llama 3.2 3B QLoRA](https://huggingface.co/meta-llama/Llama-3.2-3B-Instruct-QLORA_INT4_EO8/tree/main)
1919
- [Llama 3.2 1B QLoRA](https://huggingface.co/meta-llama/Llama-3.2-1B-Instruct-QLORA_INT4_EO8/tree/main)
2020

21-
### 3. Download Files
21+
### 3. Download files
2222
Download the `consolidated.00.pth`, `params.json` and `tokenizer.model` files. If you can't see them, make sure to check the `original` directory.
2323

24-
### 4. Rename the Tokenizer File
24+
### 4. Rename the tokenizer file
2525
Rename the `tokenizer.model` file to `tokenizer.bin` as required by the library:
2626
```bash
2727
mv tokenizer.model tokenizer.bin
2828
```
2929

30-
### 5. Run the Export Script
30+
### 5. Run the export script
3131
Navigate to the `llama_export` directory and run the following command:
3232
```bash
3333
./build_llama_binary.sh --model-path /path/to/consolidated.00.pth --params-path /path/to/params.json
3434
```
3535

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.
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.
3737

3838
:::note[Note]
3939
This Docker image was tested on MacOS with ARM chip. This might not work in other environments.

docs/docs/llms/running-llms.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ sidebar_position: 1
55

66
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:
77

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)
1010
- 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
1111

1212
## Initializing
@@ -55,7 +55,7 @@ Given computational constraints, our architecture is designed to support only on
5555
| `isReady` | `boolean` | Indicates whether the model is ready |
5656
| `downloadProgress` | `number` | Represents the download progress as a value between 0 and 1, indicating the extent of the model file retrieval. |
5757

58-
### Sending a message
58+
## Sending a message
5959

6060
In order to send a message to the model, one can use the following code:
6161

@@ -71,7 +71,7 @@ await llama.generate(message);
7171
...
7272
```
7373

74-
### Listening for the response
74+
## Listening for the response
7575

7676
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.
7777
This is how you can render the response of the model:

docs/docs/module-api/executorch-bindings.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ The `modelSource` parameter expects a location string pointing to the model bina
3838
| `loadForward` | `() => Promise<void>` | Loads resources specific to `forward` method into memory before execution. Uses `loadMethod` under the hood. |
3939
| `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. |
4040

41-
### ETInput
41+
## ETInput
4242

4343
The `ETInput` type defines the typed arrays that can be used as inputs in the `forward` method:
4444

@@ -48,7 +48,7 @@ The `ETInput` type defines the typed arrays that can be used as inputs in the `f
4848
- Float32Array
4949
- Float64Array
5050

51-
### Errors
51+
## Errors
5252

5353
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.
5454

@@ -60,7 +60,7 @@ To run model with ExecuTorch Bindings it's essential to specify the shape of the
6060

6161
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.
6262

63-
### Importing the Module and loading the model
63+
## Importing the Module and loading the model
6464

6565
First, import the necessary functions from the `react-native-executorch` package and initialize the ExecuTorch module with the specified style transfer model.
6666

@@ -77,7 +77,7 @@ const executorchModule = useExecutorchModule({
7777
```
7878

7979

80-
### Setting up input parameters
80+
## Setting up input parameters
8181

8282
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.
8383

@@ -88,7 +88,7 @@ const shape = [1, 3, 640, 640];
8888
const input = new Float32Array(1 * 3 * 640 * 640); // fill this array with your image data
8989
```
9090

91-
### Performing inference
91+
## Performing inference
9292

9393
```typescript
9494
try {

0 commit comments

Comments
 (0)