Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[mob][photos] resolve merge conflict

laurenspriemabd5234e7c05
diff --git a/mobile/lib/models/ml/ml_versions.dart b/mobile/lib/models/ml/ml_versions.dart
index a52982fb23..2d382209dc 100644
--- a/mobile/lib/models/ml/ml_versions.dart
+++ b/mobile/lib/models/ml/ml_versions.dart
@@ -1,7 +1,9 @@
+import "dart:io" show Platform;
+
const faceMlVersion = 1;
const clipMlVersion = 1;
const clusterMlVersion = 1;
const minimumClusterSize = 2;
const embeddingFetchLimit = 200;
-const fileDownloadMlLimit = 10;
+final fileDownloadMlLimit = Platform.isIOS ? 5 : 10;
diff --git a/mobile/lib/services/machine_learning/ml_service.dart b/mobile/lib/services/machine_learning/ml_service.dart
index d54d45000c..5a562b710b 100644
--- a/mobile/lib/services/machine_learning/ml_service.dart
+++ b/mobile/lib/services/machine_learning/ml_service.dart
@@ -170,7 +170,7 @@ class MLService {
_isIndexingOrClusteringRunning = true;
_logger.info('starting image indexing');
final Stream<List<FileMLInstruction>> instructionStream =
- fetchEmbeddingsAndInstructions();
+ fetchEmbeddingsAndInstructions(fileDownloadMlLimit);
int fileAnalyzedCount = 0;
final Stopwatch stopwatch = Stopwatch()..start();
diff --git a/mobile/lib/utils/ml_util.dart b/mobile/lib/utils/ml_util.dart
index c30872c4bf..13fb1474c7 100644
--- a/mobile/lib/utils/ml_util.dart
+++ b/mobile/lib/utils/ml_util.dart
@@ -152,9 +152,8 @@ Future<List<FileMLInstruction>> getFilesForMlIndexing() async {
return sortedBylocalID;
}
-Stream<List<FileMLInstruction>> fetchEmbeddingsAndInstructions({
- int yieldSize = fileDownloadMlLimit,
-}) async* {
+Stream<List<FileMLInstruction>> fetchEmbeddingsAndInstructions(
+ int yieldSize,) async* {
final List<FileMLInstruction> filesToIndex = await getFilesForMlIndexing();
final List<List<FileMLInstruction>> chunks =
filesToIndex.chunks(embeddingFetchLimit);
@@ -167,7 +166,7 @@ Stream<List<FileMLInstruction>> fetchEmbeddingsAndInstructions({
for (final batch in batches) {
yield batch;
}
- continue;
+ continue;
}
final Set<int> ids = {};
final Map<int, FileMLInstruction> pendingIndex = {};