Skip to content

Commit 9ef4907

Browse files
authored
Merge branch 'main' into @ms/refactor-jsi-conversion
2 parents 9240387 + 62ac55d commit 9ef4907

498 files changed

Lines changed: 22177 additions & 5613 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cspell-wordlist.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ torch
66
huggingface
77
bbox
88
bboxes
9+
chatbots
10+
llms
911
deeplab
1012
unsqueeze
1113
qlora
@@ -19,6 +21,7 @@ microcontrollers
1921
notimestamps
2022
seqs
2123
smollm
24+
llms
2225
qwen
2326
XNNPACK
2427
EFFICIENTNET
@@ -106,3 +109,16 @@ sublist
106109
TTFT
107110
timestamping
108111
logprob
112+
RNFS
113+
pogodin
114+
kesha
115+
antonov
116+
rfdetr
117+
basemodule
118+
IMAGENET
119+
lraspp
120+
LRASPP
121+
worklet
122+
worklets
123+
BGRA
124+
RGBA

.cspell.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"version": "0.2",
33
"language": "en",
4-
"ignorePaths": ["**/node_modules", "**/Pods"],
4+
"ignorePaths": ["**/node_modules", "**/Pods", "**/readmes/**"],
55
"dictionaryDefinitions": [
66
{
77
"name": "project-words",

.github/dependabot.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "npm"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
groups:
8+
security-updates:
9+
applies-to: security-updates
10+
patterns:
11+
- "*"
12+
13+
- package-ecosystem: "npm"
14+
directory: "/packages/react-native-executorch"
15+
schedule:
16+
interval: "weekly"
17+
groups:
18+
security-updates:
19+
applies-to: security-updates
20+
patterns:
21+
- "*"
22+
23+
- package-ecosystem: "npm"
24+
directory: "/packages/bare-resource-fetcher"
25+
schedule:
26+
interval: "weekly"
27+
groups:
28+
security-updates:
29+
applies-to: security-updates
30+
patterns:
31+
- "*"
32+
33+
- package-ecosystem: "npm"
34+
directory: "/packages/expo-resource-fetcher"
35+
schedule:
36+
interval: "weekly"
37+
groups:
38+
security-updates:
39+
applies-to: security-updates
40+
patterns:
41+
- "*"
42+
43+
- package-ecosystem: "npm"
44+
directory: "/apps/llm"
45+
schedule:
46+
interval: "weekly"
47+
groups:
48+
security-updates:
49+
applies-to: security-updates
50+
patterns:
51+
- "*"
52+
53+
- package-ecosystem: "npm"
54+
directory: "/apps/computer-vision"
55+
schedule:
56+
interval: "weekly"
57+
groups:
58+
security-updates:
59+
applies-to: security-updates
60+
patterns:
61+
- "*"
62+
63+
- package-ecosystem: "npm"
64+
directory: "/apps/speech"
65+
schedule:
66+
interval: "weekly"
67+
groups:
68+
security-updates:
69+
applies-to: security-updates
70+
patterns:
71+
- "*"
72+
73+
- package-ecosystem: "npm"
74+
directory: "/apps/text-embeddings"
75+
schedule:
76+
interval: "weekly"
77+
groups:
78+
security-updates:
79+
applies-to: security-updates
80+
patterns:
81+
- "*"
82+
83+
- package-ecosystem: "npm"
84+
directory: "/docs"
85+
schedule:
86+
interval: "weekly"
87+
groups:
88+
security-updates:
89+
applies-to: security-updates
90+
patterns:
91+
- "*"
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Check if API reference is up-to-date
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'docs/**'
9+
- 'packages/react-native-executorch/src/**'
10+
- '.github/workflows/api-reference-up-to-date-check.yml'
11+
pull_request:
12+
branches:
13+
- main
14+
paths:
15+
- 'docs/**'
16+
- 'packages/react-native-executorch/src/**'
17+
- '.github/workflows/api-reference-up-to-date-check.yml'
18+
workflow_dispatch:
19+
jobs:
20+
check:
21+
if: github.repository == 'software-mansion/react-native-executorch'
22+
runs-on: ubuntu-latest
23+
concurrency:
24+
group: api-reference-up-to-date-${{ github.ref }}
25+
cancel-in-progress: true
26+
env:
27+
WORKING_DIRECTORY: docs
28+
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@v3
31+
with:
32+
ref: ${{ github.event.pull_request.head.sha }}
33+
- name: Use Node.js 20
34+
uses: actions/setup-node@v4
35+
with:
36+
node-version: 20
37+
- name: Install root dependencies
38+
run: yarn install --immutable
39+
- name: Install node docs dependencies
40+
working-directory: ${{ env.WORKING_DIRECTORY }}
41+
run: yarn install --immutable
42+
- name: Check TypeDoc is up-to-date
43+
working-directory: ${{ env.WORKING_DIRECTORY }}
44+
run: |
45+
yarn docusaurus generate-typedoc
46+
yarn prettier-api-reference
47+
git status
48+
git diff
49+
if ! git diff --quiet; then
50+
echo "Differences found. Look at the 'git diff' output above."
51+
exit 1
52+
fi

.github/workflows/ci.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
run: yarn lint
2525

2626
- name: Typecheck files
27-
run: yarn typecheck
27+
run: yarn workspaces foreach --all --topological-dev run prepare && yarn typecheck
2828

2929
build-library:
3030
runs-on: ubuntu-latest
@@ -35,7 +35,5 @@ jobs:
3535
- name: Setup
3636
uses: ./.github/actions/setup
3737

38-
- name: Build package
39-
run: |
40-
cd packages/react-native-executorch
41-
yarn prepare
38+
- name: Build all packages
39+
run: yarn workspaces foreach --all --topological-dev run prepare

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v20
1+
v22

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,15 @@ React Native ExecuTorch is powering [Private Mind](https://privatemind.swmansion
7676
```bash
7777
# Install the package
7878
yarn add react-native-executorch
79+
80+
# If you use expo, please add these packages for resource fetching:
81+
yarn add @react-native-executorch/expo-adapter
82+
yarn add expo-file-system expo-asset
83+
84+
#if you use bare React Native project use these packages:
85+
yarn add @react-native-executorch/bare-adapter
86+
yarn add @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-downloader
87+
7988
# Depending on the platform, choose either iOS or Android
8089
yarn expo run:< ios | android >
8190
```
@@ -88,8 +97,14 @@ Add this to your component file:
8897
import {
8998
useLLM,
9099
LLAMA3_2_1B,
91-
Message
100+
Message,
101+
initExecutorch,
92102
} from 'react-native-executorch';
103+
import { ExpoResourceFetcher } from '@react-native-executorch/expo-resource-fetcher';
104+
105+
initExecutorch({
106+
resourceFetcher: ExpoResourceFetcher,
107+
});
93108

94109
function MyComponent() {
95110
// Initialize the model 🚀

RELEASE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The release process of new minor version consists of the following steps:
1010
4. Create a new release branch `release/{MAJOR}.{MINOR}`and push it to the remote.
1111
5. Stability tests are performed on the release branch and all fixes to the new-found issues are pushed into the main branch and cherry-picked into the release branch. This allows for further development on the main branch without interfering with the release process.
1212
6. Once all tests are passed, tag the release branch with proper version tag `v{MAJOR}.{MINOR}.0` and run `npm publish`.
13-
7. Create versioned docs by running from repo root `(cd docs && yarn docusaurus docs:version {MAJOR}.{MINOR}.x)` (the 'x' part is intentional and is not to be substituted). Also, make sure that all the links in `api-reference` are not broken.
13+
7. Create versioned docs by running from repo root `(cd docs && yarn docs:version {MAJOR}.{MINOR}.x)` (the 'x' part is intentional and is not to be substituted). Also, make sure that all the links in `api-reference` are not broken.
1414
8. Create a PR with the updated docs.
1515
9. Create the release notes on GitHub.
1616
10. Update README.md with release video, if available.

apps/computer-vision/app.json

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,23 @@
2525
"foregroundImage": "./assets/icons/adaptive-icon.png",
2626
"backgroundColor": "#ffffff"
2727
},
28-
"package": "com.anonymous.computervision"
28+
"package": "com.anonymous.computervision",
29+
"permissions": ["android.permission.CAMERA"]
2930
},
3031
"web": {
3132
"favicon": "./assets/icons/favicon.png"
3233
},
33-
"plugins": ["expo-font", "expo-router"]
34+
"plugins": [
35+
"expo-font",
36+
"expo-router",
37+
[
38+
"expo-build-properties",
39+
{
40+
"android": {
41+
"minSdkVersion": 26
42+
}
43+
}
44+
]
45+
]
3446
}
3547
}

apps/computer-vision/app/_layout.tsx

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
import { Drawer } from 'expo-router/drawer';
2+
import { initExecutorch } from 'react-native-executorch';
3+
import { ExpoResourceFetcher } from '@react-native-executorch/expo-resource-fetcher';
4+
25
import ColorPalette from '../colors';
36
import React, { useState } from 'react';
47
import { Text, StyleSheet, View } from 'react-native';
@@ -10,6 +13,10 @@ import {
1013
} from '@react-navigation/drawer';
1114
import { GeneratingContext } from '../context';
1215

16+
initExecutorch({
17+
resourceFetcher: ExpoResourceFetcher,
18+
});
19+
1320
interface CustomDrawerProps extends DrawerContentComponentProps {
1421
isGenerating: boolean;
1522
}
@@ -61,10 +68,10 @@ export default function _layout() {
6168
}}
6269
/>
6370
<Drawer.Screen
64-
name="image_segmentation/index"
71+
name="semantic_segmentation/index"
6572
options={{
66-
drawerLabel: 'Image Segmentation',
67-
title: 'Image Segmentation',
73+
drawerLabel: 'Semantic Segmentation',
74+
title: 'Semantic Segmentation',
6875
headerTitleStyle: { color: ColorPalette.primary },
6976
}}
7077
/>
@@ -76,6 +83,14 @@ export default function _layout() {
7683
headerTitleStyle: { color: ColorPalette.primary },
7784
}}
7885
/>
86+
<Drawer.Screen
87+
name="object_detection_live/index"
88+
options={{
89+
drawerLabel: 'Object Detection (Live)',
90+
title: 'Object Detection (Live)',
91+
headerTitleStyle: { color: ColorPalette.primary },
92+
}}
93+
/>
7994
<Drawer.Screen
8095
name="ocr/index"
8196
options={{

0 commit comments

Comments
 (0)