Skip to content

Commit

Permalink
[mob][photos] Fix in isolate message
Browse files Browse the repository at this point in the history
  • Loading branch information
laurenspriem committed Jul 26, 2024
1 parent e205b07 commit 3cc05d5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions mobile/lib/services/machine_learning/ml_computer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ enum MLComputerOperation {
}

class MLComputer {
final _logger = Logger('MLComputerIsolate');
final _logger = Logger('MLComputer');

final _initLock = Lock();
final _functionLock = Lock();
Expand Down Expand Up @@ -99,7 +99,7 @@ class MLComputer {
break;
case MLComputerOperation.runClipText:
final textEmbedding = await ClipTextEncoder.predict(args);
sendPort.send(List.from(textEmbedding, growable: false));
sendPort.send(List<double>.from(textEmbedding, growable: false));
break;
}
} catch (e, stackTrace) {
Expand Down Expand Up @@ -158,8 +158,8 @@ class MLComputer {
}

Future<List<double>> runClipText(String query) async {
await _ensureLoadedClipTextModel();
try {
await _ensureLoadedClipTextModel();
final int clipAddress = ClipTextEncoder.instance.sessionAddress;
final textEmbedding = await _runInIsolate(
(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class MLIndexingIsolate {
);
addresses.add(address);
}
sendPort.send(List.from(addresses, growable: false));
sendPort.send(List<int>.from(addresses, growable: false));
break;
case MLIndexingOperation.releaseModels:
final modelNames = args['modelNames'] as List<String>;
Expand Down

0 comments on commit 3cc05d5

Please sign in to comment.