Skip to content

armgit / ente

Public Imported from GitHub
0

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

Fix 1

Manav Rathi1ae0f9723c04
diff --git a/desktop/src/main/ipc.ts b/desktop/src/main/ipc.ts
index 511460c6c7..fd6325c5cc 100644
--- a/desktop/src/main/ipc.ts
+++ b/desktop/src/main/ipc.ts
@@ -44,12 +44,7 @@ import {
import { convertToJPEG, generateImageThumbnail } from "./services/image";
import { logout } from "./services/logout";
import { createMLWorker } from "./services/ml";
-import {
- computeCLIPImageEmbedding,
- computeCLIPTextEmbeddingIfAvailable,
- computeFaceEmbeddings,
- detectFaces,
-} from "./services/ml-worker";
+
import {
encryptionKey,
lastShownChangelogVersion,
@@ -189,21 +184,22 @@ export const attachIPCHandlers = () => {
// - ML
- ipcMain.handle("computeCLIPImageEmbedding", (_, input: Float32Array) =>
- computeCLIPImageEmbedding(input),
- );
+ // TODO:
+ // ipcMain.handle("computeCLIPImageEmbedding", (_, input: Float32Array) =>
+ // computeCLIPImageEmbedding(input),
+ // );
- ipcMain.handle("computeCLIPTextEmbeddingIfAvailable", (_, text: string) =>
- computeCLIPTextEmbeddingIfAvailable(text),
- );
+ // ipcMain.handle("computeCLIPTextEmbeddingIfAvailable", (_, text: string) =>
+ // computeCLIPTextEmbeddingIfAvailable(text),
+ // );
- ipcMain.handle("detectFaces", (_, input: Float32Array) =>
- detectFaces(input),
- );
+ // ipcMain.handle("detectFaces", (_, input: Float32Array) =>
+ // detectFaces(input),
+ // );
- ipcMain.handle("computeFaceEmbeddings", (_, input: Float32Array) =>
- computeFaceEmbeddings(input),
- );
+ // ipcMain.handle("computeFaceEmbeddings", (_, input: Float32Array) =>
+ // computeFaceEmbeddings(input),
+ // );
// - Upload
diff --git a/desktop/src/main/services/ml-worker.ts b/desktop/src/main/services/ml-worker.ts
index 21553da3ec..7112b5be78 100644
--- a/desktop/src/main/services/ml-worker.ts
+++ b/desktop/src/main/services/ml-worker.ts
@@ -10,9 +10,6 @@
import Tokenizer from "clip-bpe-js";
import { expose } from "comlink";
-// eslint-disable-next-line @typescript-eslint/ban-ts-comment
-// @ts-ignore
-import nodeEndpoint from "comlink/dist/umd/node-adapter";
import { net } from "electron/main";
import { existsSync } from "fs";
import fs from "node:fs/promises";
@@ -21,6 +18,8 @@ import * as ort from "onnxruntime-node";
import { ensure, wait } from "../utils/common";
import { writeStream } from "../utils/stream";
+const nodeEndpoint = require("comlink/dist/umd/node-adapter");
+
/**
* We cannot do
*
diff --git a/desktop/src/main/services/ml.ts b/desktop/src/main/services/ml.ts
index eef362ccc4..66c699b5d2 100644
--- a/desktop/src/main/services/ml.ts
+++ b/desktop/src/main/services/ml.ts
@@ -67,7 +67,7 @@ import log from "../log";
export const createMLWorker = (window: BrowserWindow) => {
const { port1, port2 } = new MessageChannelMain();
- const child = utilityProcess.fork(path.join(__dirname, "ml-util-test.js"));
+ const child = utilityProcess.fork(path.join(__dirname, "ml-worker.js"));
const userDataPath = app.getPath("userData");
child.postMessage({ userDataPath }, [port1]);