Skip to content
Merged

0.4.0 #314

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
9ca8288
feat: Add image segmentation example (#138)
JakubGonera Mar 24, 2025
7ec9f07
docs: Add documentation for image segmentation (#149)
JakubGonera Mar 27, 2025
346f74d
feat: add support for hugging face tokenizers, add executorch and tok…
NorbertKlockiewicz Mar 27, 2025
2145796
feat: add option to pass skip special tokens flag to decode (#162)
NorbertKlockiewicz Mar 31, 2025
a8e7f96
feat: Add multilingual Whisper (#166)
chmjkb Apr 1, 2025
6c8a629
fix: Change BOS/EOS token ids for non-multilingual Whisper in model c…
chmjkb Apr 1, 2025
a245872
fix: pass skipSpecialTokens param to Tokenizer in _TokenizerModule (#…
chmjkb Apr 3, 2025
6e210bd
feat: bump executorch 0.6.0 (#171)
NorbertKlockiewicz Apr 14, 2025
6c58d9f
Add spell checking to codebase (#185)
pweglik Apr 14, 2025
9b19a27
chore: bump model urls to use v0.4.0 tag (#169)
chmjkb Apr 15, 2025
4fb680d
deps: bump React Native versions in demo apps (#189)
chmjkb Apr 16, 2025
b8c15af
chore: @jakmro/update aar (#196)
jakmro Apr 16, 2025
093a32b
docs: add docs for mutlilingual Whisper (#176)
chmjkb Apr 16, 2025
8391067
feat: multilingual ocr (#192)
NorbertKlockiewicz Apr 22, 2025
4a5dff0
fix: error handling (#197)
pweglik Apr 22, 2025
deb768a
feat: text embeddings (#163)
jakmro Apr 23, 2025
eda47a5
feat: Add markdown spell-checker (#204)
pweglik Apr 24, 2025
52ecf0f
fix: (iOS) prevent exceeding kMaxContextLen from crashing the app (#207)
chmjkb Apr 24, 2025
9100418
chore: Add more models to modelUrls.ts (#215)
NorbertKlockiewicz Apr 25, 2025
61fd540
fix: new executorch android runtime with fix for linear op (#216)
NorbertKlockiewicz Apr 25, 2025
21d9b04
feat: Support tokenizer config and add tool support.
pweglik Apr 28, 2025
e7d9563
demo: Example app with calendar assistant using tool calling (+ docs …
pweglik Apr 28, 2025
4d4bee7
feat: add urls for qwen 3 and other models(quantized and unquantized)…
NorbertKlockiewicz May 7, 2025
1b6ddb4
chore: Bump expo SDK to version 53 (#238)
pweglik May 7, 2025
335174c
Improve SEO for LLMs (#252)
darthez May 7, 2025
af317a1
chore: huggingface/jinja bump (#265)
pweglik May 7, 2025
630f586
chore: bump audio api version and fix problem with tokenizers (#269)
NorbertKlockiewicz May 8, 2025
270faa6
feat: Improved LLM public API (#243)
pweglik May 8, 2025
4369341
chore: Merge llm-tool-calling example with llm example (#247)
pweglik May 11, 2025
c3124a3
fix: Fix keyboard covering input bar issue (#248)
pweglik May 11, 2025
5241390
feat: text embeddings dynamic size; new text embedding models consts …
jakmro May 12, 2025
b32159f
fix: Disable autocorrect in TextInput within LLM demo app (#279)
chmjkb May 12, 2025
f0da84b
Update README.md (#282)
msluszniak May 14, 2025
9d1e69e
fix: Controller initialization in ocr and s2t hooks (#283)
pweglik May 14, 2025
f01bd41
fix: Improvements and fixes in `useLLM` (#278)
pweglik May 15, 2025
fe30da9
chore: Move react-native-executorch dependency (#290)
jakmro May 16, 2025
c33c0a9
docs: Add text embeddings benchmarks (#289)
jakmro May 16, 2025
ba83046
chore: fix fetching files in speech to text controller (#274)
jakmro May 16, 2025
a200f34
fix: Remove confusing forward function (#288)
pweglik May 16, 2025
2f38823
fix: set codegen config type property to 'modules' instead of 'all' (…
chmjkb May 19, 2025
39ac729
chore: Eslint camel case (#292)
pweglik May 19, 2025
d93c08b
feat: streaming in speech to text transcription (#168)
mdydek May 19, 2025
df49582
feat: public resource fetcher (#295)
NorbertKlockiewicz May 19, 2025
152d2ad
fix: Added isReady check to generate (#296)
pweglik May 19, 2025
2818842
bug:s2t fix (#301)
mkopcins May 20, 2025
f30468d
Fix examples section in readme (#302)
pweglik May 20, 2025
f1cd9a8
chore: Bump expo file system and expo asset (#297)
jakmro May 20, 2025
3c2e781
chore: Update docs (#308)
jakmro May 20, 2025
5e58a9d
chore: bump library version in package.json to v0.4.0 👀 (#312)
chmjkb May 21, 2025
79a314d
fix: Fixes in llm after QA (#309)
pweglik May 21, 2025
1ef9863
Merge branch 'main' into v0.4.0-rc1-with-merged-main
pweglik May 21, 2025
2e0a542
Add workflow dispatch and remove double code from locks
pweglik May 22, 2025
86abbad
One more duplicate
pweglik May 22, 2025
91d3510
Merge main into 0.4.0 + small fixes (#316)
pweglik May 22, 2025
e674384
Merge branch 'v0.4.0-rc1-with-merged-main' into v0.4.0-rc1
pweglik May 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
51 changes: 51 additions & 0 deletions .cspell-wordlist.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
swmansion
executorch
execu
Execu
torch
huggingface
bbox
bboxes
deeplab
unsqueeze
qlora
spinquant
efficientnet
ssdlite
udnie
crnn
mobilenet
microcontrollers
notimestamps
seqs
smollm
qwen
XNNPACK
EFFICIENTNET
SSDLITE
MOBILENET
UDNIE
CRNN
SPINQUANT
QLORA
GGUF
deeplabv
DEELABV
ARGMAX
Abaza
Adyghe
Chech
Dargwa
Ingush
Karbadian
Lezghian
Occitan
Tabassaran
Sinhala
Infima
sublabel
Aeonik
Lexend
finetuned
MINILM
MPNET
12 changes: 12 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": "0.2",
"language": "en",
"ignorePaths": ["**/node_modules", "**/Pods"],
"dictionaryDefinitions": [
{
"name": "project-words",
"path": ".cspell-wordlist.txt"
}
],
"dictionaries": ["project-words"]
}
38 changes: 38 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"parserOptions": {
"requireConfigFile": false,
"babelOptions": {
"presets": [
"@babel/preset-react"
]
}
},
"root": true,
"extends": [
"@react-native",
"prettier",
"plugin:@cspell/recommended"
],
"rules": {
"react/react-in-jsx-scope": "off",
"prettier/prettier": [
"error",
{
"quoteProps": "consistent",
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5",
"useTabs": false
}
],
"@cspell/spellchecker": ["warn", { "customWordListFile": ".cspell-wordlist.txt" }],
"camelcase": "error"
},
"plugins": [
"eslint-plugin-prettier"
],
"ignorePatterns": [
"node_modules/",
"lib/"
]
}
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
name: Llama Example app Android build check
name: LLM Example app Android build check
on:
pull_request:
paths:
- .github/workflows/build-android-llama-example.yml
- .github/workflows/build-android-llm-example.yml
- android/**
- third-party/android/**
- examples/llama/package.json
- examples/llama/android/**
- examples/llm/package.json
- examples/llm/android/**
push:
branches:
- main
paths:
- .github/workflows/build-android-llama-example.yml
- .github/workflows/build-android-llm-example.yml
- android/**
- third-party/android/**
- examples/llama/package.json
- examples/llama/android/**
- examples/llm/package.json
- examples/llm/android/**
workflow_dispatch:
jobs:
build:
if: github.repository == 'software-mansion/react-native-executorch'
runs-on: ubuntu-latest
env:
WORKING_DIRECTORY: examples/llama
WORKING_DIRECTORY: examples/llm
concurrency:
group: android-${{ github.ref }}
cancel-in-progress: true
Expand All @@ -35,6 +35,7 @@ jobs:
distribution: 'zulu'
java-version: 17
- name: Install node dependencies
working-directory: ${{ env.WORKING_DIRECTORY }}
run: yarn install --immutable
- name: Build app
working-directory: ${{ env.WORKING_DIRECTORY }}/android
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
name: Llama Example app iOS build check
name: LLM Example app iOS build check
on:
push:
branches:
- main
paths:
- '.github/workflows/build-ios-llama-example.yml'
- '.github/workflows/build-ios-llm-example.yml'
- '*.podspec'
- 'examples/llama/ios/**'
- 'examples/llama/package.json'
- 'examples/llm/ios/**'
- 'examples/llm/package.json'
pull_request:
paths:
- '.github/workflows/build-ios-llama-example.yml'
- '.github/workflows/build-ios-llm-example.yml'
- '*.podspec'
- 'examples/llama/ios/**'
- 'examples/llama/package.json'
- 'examples/llm/ios/**'
- 'examples/llm/package.json'
workflow_dispatch:
jobs:
build:
Expand All @@ -23,20 +23,23 @@ jobs:
group: ios-${{ github.ref }}
cancel-in-progress: true
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Check out Git repository
uses: actions/checkout@v4
- name: Install node dependencies
working-directory: examples/llama
working-directory: examples/llm
run: yarn
- name: Install pods
working-directory: examples/llama/ios
working-directory: examples/llm/ios
run: pod install
- name: Build app
working-directory: examples/llama/ios
working-directory: examples/llm/ios
run: |
set -o pipefail && xcodebuild \
-workspace llama.xcworkspace \
-scheme llama \
-workspace llm.xcworkspace \
-scheme llm \
-sdk iphonesimulator \
-configuration Debug \
-destination 'platform=iOS Simulator,name=iPhone 16 Pro' \
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,7 @@ lib/
# React Native Codegen
ios/generated
android/generated

# custom
*.tgz
Makefile
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "executorch"]
path = third-party/executorch
url = https://github.com/software-mansion-labs/executorch
[submodule "tokenizers-cpp"]
path = third-party/tokenizers-cpp
url = https://github.com/software-mansion-labs/tokenizers-cpp
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"quoteProps": "consistent",
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5",
"useTabs": false
}
41 changes: 29 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,25 @@

**ExecuTorch** is a novel framework created by Meta that enables running AI models on devices such as mobile phones or microcontrollers. React Native ExecuTorch bridges the gap between React Native and native platform capabilities, allowing developers to run AI models locally on mobile devices with state-of-the-art performance, without requiring deep knowledge of native code or machine learning internals.

**Table of contents:**

- [Compatibility](#compatibility)
- [Ready-made models 🤖](#readymade-models-)
- [Documentation 📚](#documentation-)
- [🦙 Quickstart - Running Llama](#-quickstart---running-llama)
- [Minimal supported versions](#minimal-supported-versions)
- [Examples 📲](#examples-)
- [Warning](#warning)
- [License](#license)
- [What's next?](#whats-next)

## Compatibility

React Native Executorch supports only the [New React Native architecture](https://reactnative.dev/architecture/landing-page).

If your app still runs on the old architecture, please consider upgrading to the New Architecture.

## Readymade models 🤖
## Ready-made models 🤖

To run any AI model in ExecuTorch, you need to export it to a `.pte` format. If you're interested in experimenting with your own models, we highly encourage you to check out the [Python API](https://pypi.org/project/executorch/). If you prefer focusing on developing your React Native app, we will cover several common use cases. For more details, please refer to the documentation.

Expand Down Expand Up @@ -43,16 +55,17 @@ Add this to your component file:

```tsx
import {
LLAMA3_2_3B_QLORA,
LLAMA3_2_3B_TOKENIZER,
useLLM,
LLAMA3_2_1B,
LLAMA3_2_TOKENIZER_CONFIG,
} from 'react-native-executorch';

function MyComponent() {
// Initialize the model 🚀
const llama = useLLM({
modelSource: LLAMA3_2_3B_QLORA,
tokenizerSource: LLAMA3_2_3B_TOKENIZER,
modelSource: LLAMA3_2_1B,
tokenizerSource: LLAMA3_2_TOKENIZER,
tokenizerConfigSource: LLAMA3_2_TOKENIZER_CONFIG,
});
// ... rest of your component
}
Expand All @@ -64,11 +77,14 @@ function MyComponent() {

```tsx
const handleGenerate = async () => {
const prompt = 'The meaning of life is';

// Generate text based on your desired prompt
const response = await llama.generate(prompt);
console.log('Llama says:', response);
const chat = [
{ role: 'system' content: 'You are a helpful assistant' }
{ role: 'user', content: 'What is the meaning of life?' }
];

// Chat completion
await llm.generate(chat);
console.log('Llama says:', llm.response);
};
```

Expand All @@ -82,11 +98,12 @@ https://github.com/user-attachments/assets/27ab3406-c7f1-4618-a981-6c86b53547ee

We currently host a few example apps demonstrating use cases of our library:

- examples/llm - chat application showcasing use of LLMs
- examples/speech-to-text - Whisper and Moonshine models ready for transcription tasks
- examples/computer-vision - computer vision related tasks
- examples/llama - chat applications showcasing use of LLMs
- examples/text-embeddings - computing text representations for semantic search

If you would like to run it, navigate to it's project directory, for example `examples/llama` from the repository root and install dependencies with:
If you would like to run it, navigate to it's project directory, for example `examples/llm` from the repository root and install dependencies with:

```bash
yarn
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ dependencies {
implementation "com.facebook.react:react-android:+"
implementation 'org.opencv:opencv:4.10.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'com.github.software-mansion:react-native-executorch:main-SNAPSHOT'
implementation(files("libs/executorch.aar"))
implementation 'org.opencv:opencv:4.10.0'
implementation("com.squareup.okhttp3:okhttp:4.9.2")
}
Binary file added android/libs/executorch.aar
Binary file not shown.
3 changes: 1 addition & 2 deletions android/src/main/java/com/swmansion/rnexecutorch/ETModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import com.swmansion.rnexecutorch.utils.ETError
import com.swmansion.rnexecutorch.utils.TensorUtils
import org.pytorch.executorch.EValue
import org.pytorch.executorch.Module
import java.net.URL

class ETModule(
reactContext: ReactApplicationContext,
Expand All @@ -23,7 +22,7 @@ class ETModule(
modelSource: String,
promise: Promise,
) {
module = Module.load(URL(modelSource).path)
module = Module.load(modelSource)
promise.resolve(0)
}

Expand Down
Loading
Loading