Skip to content

armgit / ente

Public Imported from GitHub
0

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

ML Lite (#3838)

Neeraj Gupta27dd13324ee3
diff --cc mobile/lib/services/remote_assets_service.dart
index e14155af1b,601d64a9d0..e3b27a8a9f
--- a/mobile/lib/services/remote_assets_service.dart
+++ b/mobile/lib/services/remote_assets_service.dart
@@@ -121,14 -121,21 +121,21 @@@ class RemoteAssetsService
const oldModelNames = [
"https://models.ente.io/clip-image-vit-32-float32.onnx",
"https://models.ente.io/clip-text-vit-32-uint8.onnx",
- "https://models.ente.io/mobileclip_s2_image.onnx",
"https://models.ente.io/mobileclip_s2_image_opset18_rgba_sim.onnx",
+ "https://models.ente.io/mobileclip_s2_image_opset18_rgba_opt.onnx",
"https://models.ente.io/mobileclip_s2_text_int32.onnx",
- "https://models.ente.io/yolov5s_face_640_640_dynamic.onnx",
"https://models.ente.io/yolov5s_face_opset18_rgba_opt.onnx",
+ "https://models.ente.io/yolov5s_face_opset18_rgba_opt_nosplits.onnx",
];
- for (final remotePath in oldModelNames) {
+ await cleanupSelectedModels(oldModelNames);
+
+ checkRemovedOldAssets = true;
+ _logger.info("Old ML models cleaned up");
+ }
+
+ Future<void> cleanupSelectedModels(List<String> modelRemotePaths) async {
+ for (final remotePath in modelRemotePaths) {
final localPath = await _getLocalPath(remotePath);
if (File(localPath).existsSync()) {
_logger.info(