Parallelize model initialization
This commit is contained in:
parent
0b1bb7acc5
commit
860b5d74d8
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue