Parallelize model initialization

This commit is contained in:
vishnukvmd 2024-01-11 13:59:17 +05:30
parent 0b1bb7acc5
commit 860b5d74d8

View file

@ -47,8 +47,7 @@ abstract class MLFramework {
/// initialization. For eg. if you wish to load the model from `/assets`
/// instead of a CDN.
Future<void> init() async {
await _initImageModel();
await _initTextModel();
await Future.wait([_initImageModel(), _initTextModel()]);
_initState = InitializationState.initialized;
}