Skip to content

armgit / ente

Public Imported from GitHub
0

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

use updated computeTextEmbedding API

Abhinav76a3d87687de
diff --git a/apps/photos/src/services/clipService.ts b/apps/photos/src/services/clipService.ts
index c765ed6fed..08ef8d6235 100644
--- a/apps/photos/src/services/clipService.ts
+++ b/apps/photos/src/services/clipService.ts
@@ -143,9 +143,12 @@ class ClipServiceImpl {
}
};
- getTextEmbedding = async (text: string): Promise<Float32Array> => {
+ getTextEmbedding = async (
+ text: string,
+ model: Model = Model.ONNX_CLIP
+ ): Promise<Float32Array> => {
try {
- return ElectronAPIs.computeTextEmbedding(text);
+ return ElectronAPIs.computeTextEmbedding(model, text);
} catch (e) {
if (e?.message?.includes(CustomError.UNSUPPORTED_PLATFORM)) {
this.unsupportedPlatform = true;
diff --git a/packages/shared/electron/types.ts b/packages/shared/electron/types.ts
index 77a0cb55bf..affb99faaf 100644
--- a/packages/shared/electron/types.ts
+++ b/packages/shared/electron/types.ts
@@ -106,7 +106,7 @@ export interface ElectronAPIsType {
model: Model,
imageData: Uint8Array
) => Promise<Float32Array>;
- computeTextEmbedding: (text: string) => Promise<Float32Array>;
+ computeTextEmbedding: (model: Model, text: string) => Promise<Float32Array>;
getPlatform: () => Promise<'mac' | 'windows' | 'linux'>;
setCustomCacheDirectory: (directory: string) => Promise<void>;
getCacheDirectory: () => Promise<string>;