diff --git a/README.md b/README.md index 5ff740127..4c080e9a4 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,15 @@ ![Software Mansion banner](https://github.com/user-attachments/assets/fa2c4735-e75c-4cc1-970d-88905d95e3a4) +

+ English + Español + Français + 简体中文 + Português + हिंदी +

+ **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. @@ -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) @@ -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). + +Private Mind promo + ## :llama: **Quickstart - Running Llama** **Get started with AI-powered text generation in 3 easy steps!** @@ -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 @@ -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). diff --git a/RELEASE.md b/RELEASE.md index 050a0dd43..e85dfaafc 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -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 diff --git a/packages/react-native-executorch/package.json b/packages/react-native-executorch/package.json index aae842700..3f23c4a1f 100644 --- a/packages/react-native-executorch/package.json +++ b/packages/react-native-executorch/package.json @@ -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", diff --git a/readmes/README_cn.md b/readmes/README_cn.md new file mode 100644 index 000000000..1d3a8f6ed --- /dev/null +++ b/readmes/README_cn.md @@ -0,0 +1,148 @@ +
+

React Native ExecuTorch + + + Join our Discord community + +

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

+ English + Español + Français + 简体中文 + Português + हिंदी +

+ +**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) 上获得。 + +Private Mind promo + +## :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) \ No newline at end of file diff --git a/readmes/README_es.md b/readmes/README_es.md new file mode 100644 index 000000000..996342901 --- /dev/null +++ b/readmes/README_es.md @@ -0,0 +1,147 @@ +
+

React Native ExecuTorch + + + Únete a nuestra comunidad en Discord + +

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

+ English + Español + Français + 简体中文 + Português + हिंदी +

+ +**React Native ExecuTorch** ofrece una forma declarativa de ejecutar modelos de IA en el dispositivo utilizando React Native, impulsado por **ExecuTorch** :rocket:. Proporciona soporte listo para usar para una amplia gama de LLMs, modelos de visión por computadora y más. Visita nuestra página en [HuggingFace](https://huggingface.co/software-mansion) para explorar estos modelos. + +**ExecuTorch**, desarrollado por Meta, es un marco innovador que permite la ejecución de modelos de IA en dispositivos como teléfonos móviles o microcontroladores. + +React Native ExecuTorch conecta React Native con las capacidades nativas de la plataforma, permitiendo a los desarrolladores ejecutar modelos locales de IA en dispositivos móviles de manera eficiente. Esto puede lograrse sin necesidad de una gran experiencia en programación nativa o aprendizaje automático. + +[![Versión en npm](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) + +**Tabla de contenidos:** + +- [:yin_yang: Versiones compatibles](#yin_yang-versiones-compatibles) +- [:books: Documentación](#books-documentación) +- [:earth_africa: Ejemplo del mundo real](#earth_africa-ejemplo-del-mundo-real) +- [:llama: Inicio rápido - Ejecutar Llama](#llama-inicio-rápido---ejecutar-llama) +- [:calling: Aplicaciones de demostración](#calling-aplicaciones-de-demostración) +- [:robot: Modelos listos para usar](#robot-modelos-listos-para-usar) +- [:balance_scale: Licencia](#balance_scale-licencia) +- [:soon: ¿Qué sigue?](#soon-qué-sigue) + +## :yin_yang: Versiones compatibles + +Las versiones mínimas compatibles son: +* iOS 17.0 +* Android 13 +* React Native 0.76 + +> [!IMPORTANT] +> React Native ExecuTorch solo admite la [nueva arquitectura de React Native](https://reactnative.dev/architecture/landing-page). + +## :books: Documentación + +Consulta cómo nuestra biblioteca puede ayudarte a crear funciones de IA en React Native visitando nuestra documentación: +https://docs.swmansion.com/react-native-executorch + +## :earth_africa: Ejemplo del mundo real + +React Native ExecuTorch impulsa [Private Mind](https://github.com/software-mansion-labs/private-mind), una aplicación móvil de IA centrada en la privacidad disponible en [App Store](https://apps.apple.com/gb/app/private-mind/id6746713439) y [Google Play](https://play.google.com/store/apps/details?id=com.swmansion.privatemind). + +Promoción de Private Mind + +## :llama: **Inicio rápido - Ejecutar Llama** + +**¡Comienza con la generación de texto impulsada por IA en 3 sencillos pasos!** + +### :one: **Instalación** + +```bash +# Instalar el paquete +yarn add react-native-executorch +# Dependiendo de la plataforma, elige iOS o Android +yarn expo run:< ios | android > +``` + +### :two: Configuración e inicialización + +Agrega esto a tu archivo de componente: + +```tsx +import { + useLLM, + LLAMA3_2_1B, + Message +} from 'react-native-executorch'; + +function MyComponent() { + // Inicializa el modelo 🚀 + const llm = useLLM({ model: LLAMA3_2_1B }); + // ... resto de tu componente +} +``` + +### :three: ¡Ejecuta el modelo! +```tsx +const handleGenerate = async () => { + const chat: Message[] = [ + { role: 'system', content: 'Eres un asistente útil' }, + { role: 'user', content: '¿Cuál es el significado de la vida?' } + ]; + + // Generación de chat + await llm.generate(chat); + console.log('Llama dice:', llm.response); +}; +``` + +## :calling: Aplicaciones de demostración + +Actualmente alojamos algunos ejemplos de [aplicaciones](https://github.com/software-mansion/react-native-executorch/tree/main/apps) que muestran casos de uso de nuestra biblioteca: + +- `llm` - Aplicación de chat que muestra el uso de LLMs +- `speech-to-text` - Modelo Whisper listo para tareas de transcripción +- `computer-vision` - Tareas relacionadas con visión por computadora +- `text-embeddings` - Cálculo de representaciones de texto para búsqueda semántica + +Si deseas ejecutar una aplicación de demostración, navega al directorio del proyecto e instala las dependencias con: + +```bash +yarn +``` + +Luego, dependiendo de la plataforma, elige iOS o Android: + +```bash +yarn expo run:< ios | android > +``` + +> [!WARNING] +> Ejecutar LLMs requiere una cantidad significativa de RAM. Si experimentas cierres inesperados de la aplicación, intenta aumentar la cantidad de RAM asignada al emulador. + +## :robot: Modelos listos para usar + +Nuestra biblioteca incluye varios modelos de IA listos para usar; la lista completa está disponible en la documentación. Si te interesa ejecutar tu propio modelo de IA, primero debes exportarlo al formato `.pte`. Las instrucciones para hacerlo están disponibles en la [API de Python](https://docs.pytorch.org/executorch/stable/using-executorch-export.html) y en el [README de optimum-executorch]((https://github.com/huggingface/optimum-executorch?tab=readme-ov-file#option-2-export-and-load-separately)). + +## :balance_scale: Licencia + +Esta biblioteca está licenciada bajo [La Licencia MIT](./LICENSE). + +## :soon: ¿Qué sigue? + +Para conocer nuestros próximos planes y desarrollos, visita nuestros [hitos](https://github.com/software-mansion/react-native-executorch/milestones). + +## React Native ExecuTorch es creado por Software Mansion + +Desde 2012, [Software Mansion](https://swmansion.com) es una agencia de software con experiencia en el desarrollo de aplicaciones web y móviles. Somos colaboradores principales de React Native y expertos en resolver todo tipo de problemas relacionados con esta tecnología. Podemos ayudarte a construir tu próximo producto soñado – [Contrátanos](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) \ No newline at end of file diff --git a/readmes/README_fr.md b/readmes/README_fr.md new file mode 100644 index 000000000..8b3e0905a --- /dev/null +++ b/readmes/README_fr.md @@ -0,0 +1,148 @@ +
+

React Native ExecuTorch + + + Rejoignez notre communauté Discord + +

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

+ English + Español + Français + 简体中文 + Português + हिंदी +

+ +**React Native ExecuTorch** offre une manière déclarative de faire tourner des modèles AI sur des appareils utilisant React Native, propulsé par **ExecuTorch** :rocket:. Il propose un support natif pour une large gamme de LLM, de modèles de vision par ordinateur, et plus encore. Visitez notre page [HuggingFace](https://huggingface.co/software-mansion) pour explorer ces modèles. + +**ExecuTorch**, développé par Meta, est un cadre innovant permettant l'exécution de modèles AI sur des appareils comme les téléphones mobiles ou les microcontrôleurs. + +React Native ExecuTorch comble le fossé entre React Native et les capacités natives de la plateforme, permettant aux développeurs de faire tourner efficacement des modèles AI locaux sur des appareils mobiles. Cela peut être réalisé sans besoin d'une expertise approfondie en programmation native ou en apprentissage machine. + +[![version npm](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) + +**Table des matières :** + +- [:yin_yang: Versions supportées](#yin_yang-versions-support%C3%A9es) +- [:books: Documentation](#books-documentation) +- [:earth_africa: Exemple du monde réel](#earth_africa-exemple-du-monde-r%C3%A9el) +- [:llama: Démarrage rapide - Exécution de Llama](#llama-d%C3%A9marrage-rapide---ex%C3%A9cution-de-llama) +- [:calling: Applications de démonstration](#calling-applications-de-d%C3%A9monstration) +- [:robot: Modèles prêts à l'emploi](#robot-mod%C3%A8les-pr%C3%AAts-%C3%A0-l'emploi) +- [:balance_scale: Licence](#balance_scale-licence) +- [:soon: Quelle est la suite ?](#soon-quelle-est-la-suite) + +## :yin_yang: Versions supportées + +Les versions minimales supportées sont : +* iOS 17.0 +* Android 13 +* React Native 0.76 + +> [!IMPORTANT] +> React Native Executorch ne supporte que la [nouvelle architecture React Native](https://reactnative.dev/architecture/landing-page). + +## :books: Documentation + +Découvrez comment notre bibliothèque peut vous aider à construire vos fonctionnalités AI avec React Native en visitant notre documentation : +https://docs.swmansion.com/react-native-executorch + +## :earth_africa: Exemple du monde réel + +React Native ExecuTorch alimente [Private Mind](https://github.com/software-mansion-labs/private-mind), une appli AI mobile axée sur la confidentialité, disponible sur [App Store](https://apps.apple.com/gb/app/private-mind/id6746713439) et [Google Play](https://play.google.com/store/apps/details?id=com.swmansion.privatemind). + +Promo Private Mind + +## :llama: **Démarrage rapide - Exécution de Llama** + +**Commencez avec la génération de texte AI en 3 étapes faciles !** + +### :one: **Installation** + +```bash +# Installez le package +yarn add react-native-executorch +# Selon la plateforme, choisissez soit iOS soit Android +yarn expo run:< ios | android > +``` + +### :two: **Configuration et Initialisation** + +Ajoutez ceci à votre fichier de composant : + +```tsx +import { + useLLM, + LLAMA3_2_1B, + Message +} from 'react-native-executorch'; + +function MyComponent() { + // Initialisez le modèle 🚀 + const llm = useLLM({ model: LLAMA3_2_1B }); + // ... reste de votre composant +} +``` + +### :three: **Exécutez le modèle !** + +```tsx +const handleGenerate = async () => { + const chat: Message[] = [ + { role: 'system', content: "You are a helpful assistant" }, + { role: 'user', content: 'What is the meaning of life?' } + ]; + + // Complétion de chat + await llm.generate(chat); + console.log('Llama dit :', llm.response); +}; +``` + +## :calling: Applications de démonstration + +Nous hébergeons actuellement quelques applications [exemples](https://github.com/software-mansion/react-native-executorch/tree/main/apps) démontrant des cas d'utilisation de notre bibliothèque : + +- `llm` - Application de chat montrant l'utilisation de LLM +- `speech-to-text` - Modèle Whisper prêt pour les tâches de transcription +- `computer-vision` - Tâches liées à la vision par ordinateur +- `text-embeddings` - Calcul de représentations textuelles pour la recherche sémantique + +Si vous souhaitez exécuter une application de démonstration, accédez à son répertoire de projet et installez les dépendances avec : + +```bash +yarn +``` + +Ensuite, selon la plateforme, choisissez soit iOS soit Android : + +```bash +yarn expo run:< ios | android > +``` + +> [!WARNING] +> L'exécution des LLM nécessite une quantité importante de RAM. Si vous rencontrez des plantages inattendus de l'application, essayez d'augmenter la quantité de RAM allouée à l'émulateur. + +## :robot: Modèles prêts à l'emploi + +Notre bibliothèque contient un certain nombre de modèles AI prêts à l'emploi ; une liste complète est disponible dans la documentation. Si vous êtes intéressé à exécuter votre propre modèle AI, vous devez d'abord l'exporter au format `.pte`. Les instructions sur la façon de faire cela sont disponibles dans [l'API Python](https://docs.pytorch.org/executorch/stable/using-executorch-export.html) et le [README optimum-executorch](https://github.com/huggingface/optimum-executorch?tab=readme-ov-file#option-2-export-and-load-separately). + +## :balance_scale: Licence + +Cette bibliothèque est sous licence [MIT](./LICENSE). + +## :soon: Quelle est la suite ? + +Pour en savoir plus sur nos futures plans et développements, veuillez consulter nos [jalons](https://github.com/software-mansion/react-native-executorch/milestones). + +## React Native ExecuTorch est créé par Software Mansion + +Depuis 2012, [Software Mansion](https://swmansion.com) est une agence de développement avec de l'expérience dans la création d'applications web et mobiles. Nous sommes Contributeurs React Native Core et experts dans la gestion de tous types de problèmes React Native. Nous pouvons vous aider à créer votre prochain produit rêvé – [Engagez-nous](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) \ No newline at end of file diff --git a/readmes/README_in.md b/readmes/README_in.md new file mode 100644 index 000000000..a835b7404 --- /dev/null +++ b/readmes/README_in.md @@ -0,0 +1,148 @@ +
+

React Native ExecuTorch + + + Join our Discord community + +

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

+ English + Español + Français + 简体中文 + Português + हिंदी +

+ +**React Native ExecuTorch** एक घोषणात्मक तरीका प्रदान करता है जिससे React Native का उपयोग करके उपकरण पर AI मॉडल्स को चलाया जा सके, जो **ExecuTorch** द्वारा संचालित है :rocket:. यह LLMs, कंप्यूटर विज़न मॉडल्स, और भी कई के लिए आउट-ऑफ़-द-बॉक्स सपोर्ट प्रदान करता है। इन मॉडलों का अन्वेषण करने के लिए हमारे [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-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 केवल [नई React Native आर्किटेक्चर](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) पर उपलब्ध है। + +Private Mind promo + +## :llama: **त्वरित शुरुआत - ललामा चलाना** + +**AI-समर्थित पाठ पीढ़ी के साथ आरंभ करें, केवल 3 आसान कदमों में!** + +### :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` - चैट एप्लिकेशन जो LLMs के उपयोग को दिखाता है +- `speech-to-text` - व्हिस्पर मॉडल ट्रांसक्रिप्शन कार्यों के लिए तैयार +- `computer-vision` - कंप्यूटर विज़न से संबंधित कार्य +- `text-embeddings` - अर्थ सेमांटिक खोज के लिए पाठ प्रस्तुतिकरण की गणना + +यदि आप डेमो ऐप चलाना चाहते हैं, तो इसके प्रोजेक्ट डायरेक्टरी में नेविगेट करें और निर्भरता इंस्टॉल करें: + +```bash +yarn +``` + +फिर, प्लेटफॉर्म के अनुसार, या तो iOS या Android चुनें: + +```bash +yarn expo run:< ios | android > +``` + +> [!WARNING] +> LLMs चलाना बड़ी मात्रा में RAM की मांग करता है। यदि आप अप्रत्याशित ऐप क्रैश का सामना कर रहे हैं, तो एमुलेटर को आवंटित RAM की मात्रा बढ़ाने का प्रयास करें। + +## :robot: तैयार-निर्मित मॉडल + +हमारी लाइब्रेरी में कई तैयार उपयोग के लिए AI मॉडल्स हैं; पूर्ण सूची दस्तावेज़ में उपलब्ध है। यदि आप अपना AI मॉडल चलाने में रुचि रखते हैं, तो पहले आपको इसे `.pte` फॉर्मेट में निर्यात करना होगा। इसे करने के निर्देश [Python API](https://docs.pytorch.org/executorch/stable/using-executorch-export.html) और [optimum-executorch README](https://github.com/huggingface/optimum-executorch?tab=readme-ov-file#option-2-export-and-load-separately) में उपलब्ध हैं। + +## :balance_scale: लाइसेंस + +यह लाइब्रेरी [The MIT License](./LICENSE) के अंतर्गत लाइसेंस प्राप्त है। + +## :soon: आगे क्या? + +हमारी आगामी योजनाओं और विकासों के बारे में जानने के लिए, कृपया हमारे [milestones](https://github.com/software-mansion/react-native-executorch/milestones) पर जाएँ। + +## React Native ExecuTorch को Software Mansion द्वारा बनाया गया है + +2012 से, [Software Mansion](https://swmansion.com) वेब और मोबाइल ऐप्स बनाने का अनुभव रखने वाली एक सॉफ्टवेयर एजेंसी है। हम Core 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) \ No newline at end of file diff --git a/readmes/README_pt.md b/readmes/README_pt.md new file mode 100644 index 000000000..f56296dda --- /dev/null +++ b/readmes/README_pt.md @@ -0,0 +1,148 @@ +
+

React Native ExecuTorch + + + Join our Discord community + +

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

+ English + Español + Français + 简体中文 + Português + हिंदी +

+ +**React Native ExecuTorch** fornece uma maneira declarativa de executar modelos de IA no dispositivo usando React Native, impulsionado pelo **ExecuTorch** :rocket:. Oferece suporte pronto para uso para uma ampla gama de LLMs, modelos de visão computacional e mais. Visite nossa página no [HuggingFace](https://huggingface.co/software-mansion) para explorar esses modelos. + +**ExecuTorch**, desenvolvido pela Meta, é uma estrutura inovadora que permite a execução de modelos de IA em dispositivos, como telefones móveis ou microcontroladores. + +React Native ExecuTorch faz a ponte entre React Native e as capacidades das plataformas nativas, permitindo que desenvolvedores executem modelos de IA localmente em dispositivos móveis de maneira eficiente. Isso pode ser alcançado sem a necessidade de extenso conhecimento em programação nativa ou aprendizado de máquina. + +[![Versão npm](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) + +**Índice:** + +- [:yin_yang: Versões Suportadas](#yin_yang-versões-suportadas) +- [:books: Documentação](#books-documentação) +- [:earth_africa: Exemplo do Mundo Real](#earth_africa-exemplo-do-mundo-real) +- [:llama: Guia Rápido - Executando Llama](#llama-guia-rápido---executando-llama) +- [:calling: Apps de Demonstração](#calling-apps-de-demonstração) +- [:robot: Modelos Prontos para Uso](#robot-modelos-prontos-para-uso) +- [:balance_scale: Licença](#balance_scale-licença) +- [:soon: O que vem a seguir?](#soon-o-que-vem-a-seguir) + +## :yin_yang: Versões Suportadas + +As versões mínimas suportadas são: +* iOS 17.0 +* Android 13 +* React Native 0.76 + +> [!IMPORTANT] +> React Native Executorch suporta apenas a [Nova Arquitetura do React Native](https://reactnative.dev/architecture/landing-page). + +## :books: Documentação + +Confira como nossa biblioteca pode ajudar você a construir recursos de IA no React Native visitando nossa documentação: +https://docs.swmansion.com/react-native-executorch + +## :earth_africa: Exemplo do Mundo Real + +React Native ExecuTorch está impulsionando o [Private Mind](https://github.com/software-mansion-labs/private-mind), um aplicativo de IA móvel com foco na privacidade, disponível na [App Store](https://apps.apple.com/gb/app/private-mind/id6746713439) e [Google Play](https://play.google.com/store/apps/details?id=com.swmansion.privatemind). + +Promoção do Private Mind + +## :llama: **Guia Rápido - Executando Llama** + +**Comece com geração de texto com IA em 3 passos simples!** + +### :one: **Instalação** + +```bash +# Instale o pacote +yarn add react-native-executorch +# Dependendo da plataforma, escolha iOS ou Android +yarn expo run:< ios | android > +``` + +### :two: **Configuração e Inicialização** + +Adicione isso ao seu arquivo de componente: + +```tsx +import { + useLLM, + LLAMA3_2_1B, + Message +} from 'react-native-executorch'; + +function MyComponent() { + // Inicialize o modelo 🚀 + const llm = useLLM({ model: LLAMA3_2_1B }); + // ... restante do seu componente +} +``` + +### :three: **Execute o modelo!** + +```tsx +const handleGenerate = async () => { + const chat: Message[] = [ + { role: 'system', content: 'Você é um assistente prestativo' }, + { role: 'user', content: 'Qual é o significado da vida?' } + ]; + + // Conclusão de chat + await llm.generate(chat); + console.log('Llama diz:', llm.response); +}; +``` + +## :calling: Apps de Demonstração + +Atualmente, hospedamos alguns [apps](https://github.com/software-mansion/react-native-executorch/tree/main/apps) de exemplo demonstrando casos de uso de nossa biblioteca: + +- `llm` - Aplicativo de chat demonstrando o uso de LLMs +- `speech-to-text` - Modelo Whisper pronto para tarefas de transcrição +- `computer-vision` - Tarefas relacionadas à visão computacional +- `text-embeddings` - Computação de representações de texto para busca semântica + +Se deseja executar o aplicativo de demonstração, navegue até o diretório do projeto e instale as dependências com: + +```bash +yarn +``` + +Então, dependendo da plataforma, escolha iOS ou Android: + +```bash +yarn expo run:< ios | android > +``` + +> [!WARNING] +> Executar LLMs requer uma quantidade significativa de RAM. Se você estiver enfrentando travamentos inesperados do aplicativo, tente aumentar a quantidade de RAM alocada para o emulador. + +## :robot: Modelos Prontos para Uso + +Nossa biblioteca possui vários modelos de IA prontos para uso; uma lista completa está disponível na documentação. Se você está interessado em executar seu próprio modelo de IA, primeiro precisa exportá-lo para o formato `.pte`. Instruções sobre como fazer isso estão disponíveis na [API Python](https://docs.pytorch.org/executorch/stable/using-executorch-export.html) e no [README do optimum-executorch](https://github.com/huggingface/optimum-executorch?tab=readme-ov-file#option-2-export-and-load-separately). + +## :balance_scale: Licença + +Esta biblioteca é licenciada sob [A Licença MIT](./LICENSE). + +## :soon: O que vem a seguir? + +Para saber sobre nossos planos e desenvolvimentos futuros, visite nossos [marcos](https://github.com/software-mansion/react-native-executorch/milestones). + +## React Native ExecuTorch é criado pela Software Mansion + +Desde 2012, a [Software Mansion](https://swmansion.com) é uma agência de software com experiência na construção de aplicativos web e móveis. Somos colaboradores principais do React Native e especialistas em lidar com todos os tipos de problemas do React Native. Podemos ajudar você a construir seu próximo produto dos sonhos – [Contrate-nos](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) \ No newline at end of file