You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`react-native-transformers` is a React Native library for incorporating transformer models into your mobile applications. It supports both iOS and Android platforms, allowing you to leverage advanced AI models directly on your device.
7
+
`react-native-transformers` is a React Native library for running Large Language Models (LLMs) from Hugging Face on your mobile applications locally. It supports both iOS and Android platforms, allowing you to leverage advanced AI models directly on your device without requiring an internet connection.
8
8
9
9
## Features
10
10
11
-
- On-device transformer model support
12
-
- Compatible with iOS and Android
13
-
- Simple API for model loading and text generation
11
+
- On-device transformer model support for both text generation and text embedding
12
+
- Local inference without internet connectivity
13
+
- Compatible with iOS and Android platforms
14
+
- Simple API for model loading and inference
15
+
- Support for Hugging Face models in ONNX format
16
+
- Built on top of ONNX Runtime for efficient model execution
17
+
- TypeScript support with full type definitions
14
18
15
19
## Installation
16
20
@@ -68,11 +72,11 @@ To use `react-native-transformers`, you need to install `onnxruntime-react-nativ
68
72
69
73
## Usage
70
74
71
-
Here is an example of how to use `react-native-transformers`in an Expo application:
75
+
### Text Generation Example
72
76
73
77
```javascript
74
78
import React from "react";
75
-
import { View, Text, Button, TextInput } from "react-native";
79
+
import { View, Text, Button } from "react-native";
76
80
import { Pipeline } from "react-native-transformers";
77
81
78
82
export default functionApp() {
@@ -98,7 +102,38 @@ export default function App() {
98
102
}
99
103
```
100
104
101
-
For detailed usage please reference ['API documentation'](https://daviddaytw.github.io/react-native-transformers/)
105
+
### Text Embedding Example
106
+
107
+
```javascript
108
+
import React from "react";
109
+
import { View, Text, Button } from "react-native";
110
+
import { Pipeline } from "react-native-transformers";
0 commit comments