From 7fe32d9e8abb2dac2620a2003570675b2fc99fe8 Mon Sep 17 00:00:00 2001 From: David Snelling Date: Tue, 27 May 2025 15:42:38 -0700 Subject: [PATCH] chore: simplify TensorFlow.js imports and bump package version to 0.2.2 Streamlined TensorFlow.js and Universal Sentence Encoder imports by removing unnecessary explicit file paths. Updated package.json version to 0.2.2. --- package.json | 2 +- src/utils/embedding.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index fdbd3ad2..1b0d28da 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@soulcraft/brainy", - "version": "0.2.1", + "version": "0.2.2", "description": "A vector database using HNSW indexing with Origin Private File System storage", "main": "dist/index.js", "module": "dist/index.js", diff --git a/src/utils/embedding.ts b/src/utils/embedding.ts index 6e101003..7445b121 100644 --- a/src/utils/embedding.ts +++ b/src/utils/embedding.ts @@ -91,8 +91,8 @@ export class UniversalSentenceEncoder implements EmbeddingModel { try { // Dynamically import TensorFlow.js and Universal Sentence Encoder // Use type assertions to tell TypeScript these modules exist - this.tf = await import('@tensorflow/tfjs/dist/tf.esm.js' as any) - this.use = await import('@tensorflow-models/universal-sentence-encoder/dist/universal-sentence-encoder.esm.js' as any) + this.tf = await import('@tensorflow/tfjs') + this.use = await import('@tensorflow-models/universal-sentence-encoder') // Load the model this.model = await this.use.load()