Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 24 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@

![Software Mansion banner](https://github.com/user-attachments/assets/fa2c4735-e75c-4cc1-970d-88905d95e3a4)

<p align="center">
<a href="https://github.com/software-mansion/react-native-executorch/blob/release/0.5/README.md">English</a>
<a href="https://github.com/software-mansion/react-native-executorch/blob/release/0.5/readmes/README_es.md">Español</a>
<a href="https://github.com/software-mansion/react-native-executorch/blob/release/0.5/readmes/README_fr.md">Français</a>
<a href="https://github.com/software-mansion/react-native-executorch/blob/release/0.5/readmes/README_cn.md">简体中文</a>
<a href="https://github.com/software-mansion/react-native-executorch/blob/release/0.5/readmes/README_pt.md">Português</a>
<a href="https://github.com/software-mansion/react-native-executorch/blob/release/0.5/readmes/README_in.md">हिंदी</a>
</p>

**React Native ExecuTorch** provides a declarative way to run AI models on-device using React Native, powered by **ExecuTorch** :rocket:. It offers out-of-the-box support for a wide range of LLMs, computer vision models, and more. Visit our [HuggingFace](https://huggingface.co/software-mansion) page to explore these models.

**ExecuTorch**, developed by Meta, is a novel framework allowing AI model execution on devices like mobile phones or microcontrollers.
Expand All @@ -21,10 +30,11 @@ React Native ExecuTorch bridges the gap between React Native and native platform
**Table of contents:**

- [:yin_yang: Supported versions](#yin_yang-supported-versions)
- [:robot: Ready-made models](#robot-ready-made-models)
- [:books: Documentation](#books-documentation)
- [:earth_africa: Real-World Example](#earth_africa-real-world-example)
- [:llama: Quickstart - Running Llama](#llama-quickstart---running-llama)
- [:calling: Examples](#calling-examples)
- [:calling: Demo apps](#calling-demo-apps)
- [:robot: Ready-made models](#robot-ready-made-models)
- [:balance_scale: License](#balance_scale-license)
- [:soon: What's next?](#soon-whats-next)

Expand All @@ -38,15 +48,17 @@ The minimal supported version are:
> [!IMPORTANT]
> React Native Executorch supports only the [New React Native architecture](https://reactnative.dev/architecture/landing-page).

## :robot: Ready-made models

Our library has a number of ready-to-use AI models; a complete list is available in the documentation. If you're interested in running your own AI model, you need to first export it to the `.pte` format. Instructions on how to do this are available in the [Python API](https://pypi.org/project/executorch/).

## :books: Documentation

Check out how our library can help you build your React Native AI features by visiting our docs:
https://docs.swmansion.com/react-native-executorch

## :earth_africa: Real-World Example

React Native ExecuTorch is powering [Private Mind](https://github.com/software-mansion-labs/private-mind), a privacy-first mobile AI app available on [App Store](https://apps.apple.com/gb/app/private-mind/id6746713439) and [Google Play](https://play.google.com/store/apps/details?id=com.swmansion.privatemind).

<img width="2720" height="1085" alt="Private Mind promo" src="https://github.com/user-attachments/assets/b12296fe-19ac-48fc-9726-da9242700346" />

## :llama: **Quickstart - Running Llama**

**Get started with AI-powered text generation in 3 easy steps!**
Expand Down Expand Up @@ -93,12 +105,12 @@ const handleGenerate = async () => {
};
```

## :calling: Examples
## :calling: Demo apps

We currently host a few example [apps](https://github.com/software-mansion/react-native-executorch/tree/main/apps) demonstrating use cases of our library:

- `llm` - Chat application showcasing use of LLMs
- `speech-to-text` - Whisper and Moonshine models ready for transcription tasks
- `speech-to-text` - Whisper model ready for transcription tasks
- `computer-vision` - Computer vision related tasks
- `text-embeddings` - Computing text representations for semantic search

Expand All @@ -117,6 +129,10 @@ yarn expo run:< ios | android >
> [!WARNING]
> Running LLMs requires a significant amount of RAM. If you are encountering unexpected app crashes, try to increase the amount of RAM allocated to the emulator.

## :robot: Ready-made models

Our library has a number of ready-to-use AI models; a complete list is available in the documentation. If you're interested in running your own AI model, you need to first export it to the `.pte` format. Instructions on how to do this are available in the [Python API](https://docs.pytorch.org/executorch/stable/using-executorch-export.html) and [optimum-executorch README](https://github.com/huggingface/optimum-executorch?tab=readme-ov-file#option-2-export-and-load-separately).

## :balance_scale: License

This library is licensed under [The MIT License](./LICENSE).
Expand Down
27 changes: 11 additions & 16 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,17 @@

The release process of new minor version consists of the following steps:

1. Merge all tickets tracked in a release tracker (i.e. [#356](https://github.com/software-mansion/react-native-executorch/issues/356)) into `main` branch.
2. Bump version in `package.json` to the new version `v{MAJOR}.{MINOR}.0`.
3. Update version tags in `packages/react-native-executorch/src/constants/modelUrls.ts` to point to the proper `MINOR` version and update tags on [🤗 huggingface](https://huggingface.co/software-mansion).
4. Update jitpack version inside `build.gradle` to point to the correct version tag
```
implementation("com.github.software-mansion:react-native-executorch:v{MAJOR}.{MINOR}.{REVISION}")
```
5. Commit with a message 'Release v{MAJOR}.{MINOR}.0'. (We want to keep the latest `MINOR` version on the `main` branch.)
6. Create a new branch release branch `release/{MAJOR}.{MINOR}`and push it to the remote.
7. 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.
8. Once all tests are passed, tag the release branch with proper version tag `v{MAJOR}.{MINOR}.0` and run `npm publish`.
9. Ensure [jitpack](https://jitpack.io/#software-mansion/react-native-executorch) triggers build properly.
10. 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).
11. Create a PR with the updated docs.
12. Create the release notes on GitHub.
13. Update README.md with release video, if available.
1. Bump version in `package.json` to the new version `v{MAJOR}.{MINOR}.0`.
2. Update version tags in `packages/react-native-executorch/src/constants/modelUrls.ts` to point to the proper `MINOR` version and update tags on [🤗 huggingface](https://huggingface.co/software-mansion).
3. Commit with a message 'Release v{MAJOR}.{MINOR}.0'. (We want to keep the latest `MINOR` version on the `main` branch.)
4. Create a new branch release branch `release/{MAJOR}.{MINOR}`and push it to the remote.
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.
6. Once all tests are passed, tag the release branch with proper version tag `v{MAJOR}.{MINOR}.0` and run `npm publish`.
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).
8. Create a PR with the updated docs.
9. Create the release notes on GitHub.
10. Update README.md with release video, if available.
11. Update README.md links to release branch.

## Patch release

Expand Down
2 changes: 1 addition & 1 deletion packages/react-native-executorch/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-executorch",
"version": "0.5.9",
"version": "0.5.10",
"description": "An easy way to run AI models in React Native with ExecuTorch",
"source": "./src/index.ts",
"main": "./lib/module/index.js",
Expand Down
148 changes: 148 additions & 0 deletions readmes/README_cn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
<div align="right">
<h1 align="left" style="display:inline-block">React Native ExecuTorch
<!-- Discord Badge -->
<a href="https://discord.gg/ZGqqY55qkP">
<img src="https://img.shields.io/badge/Discord-Join%20Us-00008B?logo=discord&logoColor=white&style=for-the-badge" alt="Join our Discord community">
</a>
</h1>
</div>

![Software Mansion banner](https://github.com/user-attachments/assets/fa2c4735-e75c-4cc1-970d-88905d95e3a4)

<p align="center">
<a href="../README.md">English</a>
<a href="README_es.md">Español</a>
<a href="README_fr.md">Français</a>
<a href="README_cn.md">简体中文</a>
<a href="README_pt.md">Português</a>
<a href="README_in.md">हिंदी</a>
</p>

**React Native ExecuTorch** 是一个使用 React Native 在设备上运行 AI 模型的声明式工具,得益于 **ExecuTorch** 的支持 :rocket:。它为各种 LLM、计算机视觉模型等提供了开箱即用的支持。访问我们的 [HuggingFace](https://huggingface.co/software-mansion) 页面,以探索这些模型。

**ExecuTorch** 由 Meta 开发,是一个创新的框架,允许在移动电话或微控制器等设备上执行 AI 模型。

React Native ExecuTorch 架起了 React Native 和原生平台功能之间的桥梁,使开发者无需深入的本地编程或机器学习知识即可高效地在移动设备上本地运行 AI 模型。

[![npm version](https://img.shields.io/npm/v/react-native-executorch?color=00008B)](https://www.npmjs.com/package/react-native-executorch)
[![CI](https://github.com/software-mansion/react-native-executorch/actions/workflows/ci.yml/badge.svg)](https://github.com/software-mansion/react-native-executorch/actions/workflows/ci.yml)

**目录:**

- [:yin_yang: 支持的版本](#yin_yang-supported-versions)
- [:books: 文档](#books-documentation)
- [:earth_africa: 实际案例](#earth_africa-real-world-example)
- [:llama: 快速入门 - 运行 Llama](#llama-quickstart---running-llama)
- [:calling: 示例应用](#calling-demo-apps)
- [:robot: 现成模型](#robot-ready-made-models)
- [:balance_scale: 许可证](#balance_scale-license)
- [:soon: 接下来是什么?](#soon-whats-next)

## :yin_yang: 支持的版本

最低支持版本为:
* iOS 17.0
* Android 13
* React Native 0.76

> [!IMPORTANT]
> React Native Executorch 仅支持 [New React Native architecture](https://reactnative.dev/architecture/landing-page)。

## :books: 文档

查看我们的文档,了解我们的库如何帮助您构建 React Native AI 功能:
https://docs.swmansion.com/react-native-executorch

## :earth_africa: 实际案例

React Native ExecuTorch 为 [Private Mind](https://github.com/software-mansion-labs/private-mind) 提供了动力,这是一款以隐私优先的移动 AI 应用程序,可在 [App Store](https://apps.apple.com/gb/app/private-mind/id6746713439) 和 [Google Play](https://play.google.com/store/apps/details?id=com.swmansion.privatemind) 上获得。

<img width="2720" height="1085" alt="Private Mind promo" src="https://github.com/user-attachments/assets/b12296fe-19ac-48fc-9726-da9242700346" />

## :llama: **快速入门 - 运行 Llama**

**通过三个简单步骤,开始使用 AI 驱动的文本生成!**

### :one: **安装**

```bash
# 安装包
yarn add react-native-executorch
# 根据平台,选择 iOS 或 Android
yarn expo run:< ios | android >
```

### :two: **设置和初始化**

将此添加到您的组件文件中:

```tsx
import {
useLLM,
LLAMA3_2_1B,
Message
} from 'react-native-executorch';

function MyComponent() {
// 初始化模型 🚀
const llm = useLLM({ model: LLAMA3_2_1B });
// ... 您组件的其余部分
}
```

### :three: **运行模型!**

```tsx
const handleGenerate = async () => {
const chat: Message[] = [
{ role: 'system', content: 'You are a helpful assistant' },
{ role: 'user', content: 'What is the meaning of life?' }
];

// 聊天生成
await llm.generate(chat);
console.log('Llama says:', llm.response);
};
```

## :calling: 示例应用

我们目前托管了一些示例 [应用程序](https://github.com/software-mansion/react-native-executorch/tree/main/apps),展示了我们库的使用案例:

- `llm` - 展现 LLM 使用的聊天应用程序
- `speech-to-text` - 准备用于转录任务的 Whisper 模型
- `computer-vision` - 计算机视觉相关任务
- `text-embeddings` - 用于语义搜索的文本表示计算

如果您想运行示例应用程序,请导航到其项目目录并安装依赖项:

```bash
yarn
```

然后,根据平台,选择 iOS 或 Android:

```bash
yarn expo run:< ios | android >
```

> [!WARNING]
> 运行 LLM 需要大量的 RAM。如果您遇到意外的应用崩溃,请尝试增加分配给模拟器的 RAM。

## :robot: 现成模型

我们的库中有许多现成可用的 AI 模型;完整列表可在文档中查看。如果您有兴趣运行自己的 AI 模型,首先需要将其导出为 `.pte` 格式。关于如何执行此操作的说明可在 [Python API](https://docs.pytorch.org/executorch/stable/using-executorch-export.html) 和 [optimum-executorch 说明](https://github.com/huggingface/optimum-executorch?tab=readme-ov-file#option-2-export-and-load-separately) 中获取。

## :balance_scale: 许可证

此库受 [MIT 许可证](./LICENSE) 许可。

## :soon: 接下来是什么?

若要了解我们的计划和发展,敬请访问我们的 [milestones](https://github.com/software-mansion/react-native-executorch/milestones)。

## React Native ExecuTorch 是由 Software Mansion 创建的

自 2012 年以来,[Software Mansion](https://swmansion.com) 是一家拥有构建网络和移动应用经验的软件机构。我们是核心 React Native 贡献者,并且是处理各种 React Native 问题的专家。我们可以帮助您构建下一个梦想产品——[雇佣我们](https://swmansion.com/contact/projects?utm_source=react-native-executorch&utm_medium=readme)。

[![swm](https://logo.swmansion.com/logo?color=white&variant=desktop&width=150&tag=react-native-executorch-github 'Software Mansion')](https://swmansion.com)
Loading
Loading