mirror of
https://github.com/ente-io/ente.git
synced 2025-08-10 16:32:39 +00:00
[mob] Select load models
This commit is contained in:
parent
08f846c315
commit
0bd04a0b8d
@ -516,7 +516,7 @@ class MLService {
|
|||||||
return actuallyRanML;
|
return actuallyRanML;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _initModels() async {
|
Future<void> _initModelsUsingFfiBasedPlugin() async {
|
||||||
return _initModelLock.synchronized(() async {
|
return _initModelLock.synchronized(() async {
|
||||||
if (_isModelsInitialized) return;
|
if (_isModelsInitialized) return;
|
||||||
_logger.info('initModels called');
|
_logger.info('initModels called');
|
||||||
@ -623,8 +623,11 @@ class MLService {
|
|||||||
|
|
||||||
Future<void> _ensureReadyForInference() async {
|
Future<void> _ensureReadyForInference() async {
|
||||||
await _initIsolate();
|
await _initIsolate();
|
||||||
await _initModels();
|
if (Platform.isAndroid) {
|
||||||
await _initModelUsingEntePlugin();
|
await _initModelUsingEntePlugin();
|
||||||
|
} else {
|
||||||
|
await _initModelsUsingFfiBasedPlugin();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The main execution function of the isolate.
|
/// The main execution function of the isolate.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user