tfjs-react-native-mmkv-storage
v3.0.0
Published
MMKV storage IO for tfjs react native based on react-native-mmkv
Downloads
9
Maintainers
Readme
tfjs-react-native-mmkv-storage
MMKV storage IO for tfjs-react-native based on react-native-mmkv.
Alternative for tfjs built-in asyncStorageIO, which is based on async-storage.
Differences with tfjs built-in asyncStorageIO:
- Use filesystem instead of SQLite on Android to avoid storage limits
- Supposedly faster
Install:
$ yarn add tfjs-react-native-mmkv-storage
Usage
import { mmkvStorageIO } from 'tfjs-react-native-mmkv-storage';
// save model
const model = tf.sequential();
// setup model...
await model.save(mmkvStorageIO(`mymodel`));
// load model
const model = await tf.loadLayersModel(mmkvStorageIO(`mymodel`));
Testing
Too complicated to setup.