Skip to content

Commit 14a6b9c

Browse files
Merge branch 'main' into @ml/llm-functional-api-context-management
2 parents d2eed3c + 2d58410 commit 14a6b9c

93 files changed

Lines changed: 3794 additions & 1537 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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,7 @@ sublist
109109
TTFT
110110
timestamping
111111
logprob
112+
RNFS
113+
pogodin
114+
kesha
115+
antonov

.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/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 🚀

apps/computer-vision/app/_layout.tsx

Lines changed: 7 additions & 0 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
}

apps/computer-vision/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"lint": "eslint . --ext .ts,.tsx --fix"
1212
},
1313
"dependencies": {
14-
"@react-native/metro-config": "^0.76.3",
14+
"@react-native-executorch/expo-resource-fetcher": "workspace:*",
15+
"@react-native/metro-config": "^0.81.5",
1516
"@react-navigation/drawer": "^7.3.9",
1617
"@react-navigation/native": "^7.1.6",
1718
"@shopify/react-native-skia": "2.2.12",
@@ -21,7 +22,7 @@
2122
"expo-linking": "~8.0.10",
2223
"expo-router": "~6.0.17",
2324
"expo-status-bar": "~3.0.9",
24-
"metro-config": "^0.81.0",
25+
"metro-config": "^0.81.5",
2526
"react": "19.1.0",
2627
"react-native": "0.81.5",
2728
"react-native-device-info": "^14.0.4",

apps/computer-vision/tsconfig.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
"customConditions": ["react-native"],
1010
"noEmit": true,
1111
"paths": {
12-
"react-native-executorch": ["../../packages/react-native-executorch/src"]
12+
"react-native-executorch": ["../../packages/react-native-executorch/src"],
13+
"@react-native-executorch/expo-resource-fetcher": [
14+
"../../packages/expo-resource-fetcher/src"
15+
]
1316
}
1417
}
1518
}

apps/llm/app/_layout.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
import { Drawer } from 'expo-router/drawer';
2+
import { initExecutorch } from 'react-native-executorch';
3+
import { ExpoResourceFetcher } from '@react-native-executorch/expo-resource-fetcher';
24
import ColorPalette from '../colors';
35
import React, { useState } from 'react';
46
import { Text, StyleSheet, View } from 'react-native';
5-
67
import {
78
DrawerContentComponentProps,
89
DrawerContentScrollView,
910
DrawerItemList,
1011
} from '@react-navigation/drawer';
1112
import { GeneratingContext } from '../context';
1213

14+
initExecutorch({
15+
resourceFetcher: ExpoResourceFetcher,
16+
});
17+
1318
interface CustomDrawerProps extends DrawerContentComponentProps {
1419
isGenerating: boolean;
1520
}

apps/llm/app/llm/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function LLMScreen() {
4747

4848
useEffect(() => {
4949
if (llm.error) {
50-
console.log('LLM error:', llm.error);
50+
console.error('LLM error:', llm.error);
5151
}
5252
}, [llm.error]);
5353

0 commit comments

Comments
 (0)