Commit graph

4 commits

Author SHA1 Message Date
e81979dc84 fix(src/utils): remove unused sentenceEncoderModule for cleanup
Removed the unused `sentenceEncoderModule` object from `workerUtils.ts` to simplify the code and improve maintainability.
2025-06-26 19:08:09 -07:00
6a8d044970 feat(src/utils): add GPU acceleration and improve threading for embeddings and distance calculations
- Integrated GPU acceleration via WebGL in `embedding.ts` and `distance.ts` for optimized performance.
- Enhanced fallback mechanisms for CPU processing when GPU is unavailable or fails to initialize.
- Added threading support for embedding and distance calculations in `embedding.ts` and `distance.ts` to improve performance and avoid blocking the main thread.
- Refactored TensorFlow.js imports to dynamically load modules (`@tensorflow/tfjs-core`, `@tensorflow/tfjs-backend-webgl`, `@tensorflow/tfjs-backend-cpu`) for modular dependency usage.
- Introduced GPU-accelerated batch distance calculations in `distance.ts` with appropriate error handling.
- Applied consistent formatting to improve code readability and maintainability while adhering to project style guidelines.
2025-06-26 19:04:37 -07:00
bd123c4bb9 fix(src/utils): enforce consistent formatting and enhance worker script initialization
Refactored worker script initialization in `src/utils/workerUtils.ts` by introducing global variables for safer script execution. Applied consistent formatting adjustments, including removal of redundant semicolons, to improve code readability and maintainability without altering functionality.
2025-06-26 10:57:24 -07:00
5a8a6c1ba3 Initial commit 2025-06-24 11:41:30 -07:00