Skip to content

Commit b013e43

Browse files
authored
feat: Add prevent load to all hooks (#323)
### Type of change - [ ] Bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Documentation update (improves or adds clarity to existing documentation) ### Tested on - [x] iOS (CV) - [ ] Android ### Related issues #303 ### Checklist - [x] I have performed a self-review of my code - [ ] I have commented my code, particularly in hard-to-understand areas - [x] I have updated the documentation accordingly - [x] My changes generate no new warnings
1 parent b105c88 commit b013e43

30 files changed

+126
-32
lines changed

docs/docs/computer-vision/useClassification.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ try {
3535
**`modelSource`**
3636
A string that specifies the location of the model binary. For more information, take a look at [loading models](../fundamentals/loading-models.md) page.
3737

38+
**`preventLoad?`** - Boolean that can prevent automatic model loading (and downloading the data if you load it for the first time) after running the hook.
39+
3840
### Returns
3941

4042
| Field | Type | Description |

docs/docs/computer-vision/useImageSegmentation.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ try {
3434
**`modelSource`**
3535
A string that specifies the location of the model binary. For more information, take a look at [loading models](../fundamentals/loading-models.md) page.
3636

37+
**`preventLoad?`** - Boolean that can prevent automatic model loading (and downloading the data if you load it for the first time) after running the hook.
38+
3739
### Returns
3840

3941
| Field | Type | Description |

docs/docs/computer-vision/useOCR.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ For more information, take a look at [loading models](../fundamentals/loading-mo
144144

145145
**`language`** - A parameter that specifies the language of the text to be recognized by the OCR.
146146

147+
**`preventLoad?`** - Boolean that can prevent automatic model loading (and downloading the data if you load it for the first time) after running the hook.
148+
147149
### Returns
148150

149151
The hook returns an object with the following properties:

docs/docs/computer-vision/useObjectDetection.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ interface Detection {
5151

5252
### Arguments
5353

54-
`modelSource`
55-
56-
A string that specifies the path to the model file. You can download the model from our [HuggingFace repository](https://huggingface.co/software-mansion/react-native-executorch-ssdlite320-mobilenet-v3-large/tree/main).
54+
**`modelSource`** - A string that specifies the path to the model file. You can download the model from our [HuggingFace repository](https://huggingface.co/software-mansion/react-native-executorch-ssdlite320-mobilenet-v3-large/tree/main).
5755
For more information on that topic, you can check out the [Loading models](https://docs.swmansion.com/react-native-executorch/fundamentals/loading-models) page.
5856

57+
**`preventLoad?`** - Boolean that can prevent automatic model loading (and downloading the data if you load it for the first time) after running the hook.
58+
5959
### Returns
6060

6161
The hook returns an object with the following properties:

docs/docs/computer-vision/useStyleTransfer.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ try {
3434
**`modelSource`**
3535
A string that specifies the location of the model binary. For more information, take a look at [loading models](../fundamentals/loading-models.md) page.
3636

37+
**`preventLoad?`** - Boolean that can prevent automatic model loading (and downloading the data if you load it for the first time) after running the hook.
38+
3739
### Returns
3840

3941
| Field | Type | Description |

docs/docs/computer-vision/useVerticalOCR.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@ For more information, take a look at [loading models](../fundamentals/loading-mo
161161

162162
**`independentCharacters`** – A boolean parameter that indicates whether the text in the image consists of a random sequence of characters. If set to true, the algorithm will scan each character individually instead of reading them as continuous text.
163163

164+
**`preventLoad?`** - Boolean that can prevent automatic model loading (and downloading the data if you load it for the first time) after running the hook.
165+
164166
### Returns
165167

166168
The hook returns an object with the following properties:

docs/docs/executorch-bindings/useExecutorchModule.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ The `modelSource` parameter expects a location string pointing to the model bina
2626

2727
**`modelSource`** - A string that specifies the location of the model binary.
2828

29+
**`preventLoad?`** - Boolean that can prevent automatic model loading (and downloading the data if you load it for the first time) after running the hook.
30+
2931
### Returns
3032

3133
| Field | Type | Description |

docs/docs/natural-language-processing/useSpeechToText.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ Specifies the size of each audio chunk (expressed in seconds). Overrides `stream
8989
**`streamingConfig?`**
9090
Specifies config for both `overlapSeconds` and `windowSize` values. Three options are available: `fast`, `balanced` and `quality`. We discourage using `fast` config with `Whisper` model which while has the lowest latency to first token has the slowest overall speed.
9191

92+
**`preventLoad?`** - Boolean that can prevent automatic model loading (and downloading the data if you load it for the first time) after running the hook.
93+
9294
### Returns
9395

9496
| Field | Type | Description |

docs/docs/natural-language-processing/useTextEmbeddings.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ A string that specifies the location of the model binary. For more information,
5050
**`tokenizerSource`**
5151
A string that specifies the location of the tokenizer JSON file.
5252

53+
**`preventLoad?`** - Boolean that can prevent automatic model loading (and downloading the data if you load it for the first time) after running the hook.
54+
5355
### Returns
5456

5557
| Field | Type | Description |

docs/docs/natural-language-processing/useTokenizer.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ try {
5151

5252
## Arguments
5353

54-
A string that specifies the path or URI of the tokenizer JSON file.
54+
**`tokenizerSource`** - A string that specifies the path or URI of the tokenizer JSON file.
55+
56+
**`preventLoad?`** - Boolean that can prevent automatic model loading (and downloading the data if you load it for the first time) after running the hook.
5557

5658
### Returns
5759

0 commit comments

Comments
 (0)