@forbocai/browser 0.4.10 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +12 -2
- package/dist/index.mjs +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __export = (target, all) => {
|
|
7
9
|
for (var name in all)
|
|
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
17
|
}
|
|
16
18
|
return to;
|
|
17
19
|
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
18
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
29
|
|
|
20
30
|
// src/index.ts
|
|
@@ -95,12 +105,12 @@ var createCortex = (config) => createBrowserCortex(config);
|
|
|
95
105
|
var import_orama = require("@orama/orama");
|
|
96
106
|
|
|
97
107
|
// src/vector.ts
|
|
98
|
-
var import_transformers = require("@xenova/transformers");
|
|
99
108
|
var embedder = null;
|
|
100
109
|
var initVectorEngine = async () => {
|
|
101
110
|
if (embedder) return;
|
|
102
111
|
console.log("> Initializing Browser Vector Engine...");
|
|
103
|
-
|
|
112
|
+
const { pipeline } = await import("@huggingface/transformers");
|
|
113
|
+
embedder = await pipeline("feature-extraction", "Xenova/all-MiniLM-L6-v2");
|
|
104
114
|
};
|
|
105
115
|
var generateEmbedding = async (text) => {
|
|
106
116
|
if (!embedder) await initVectorEngine();
|
package/dist/index.mjs
CHANGED
|
@@ -63,11 +63,11 @@ var createCortex = (config) => createBrowserCortex(config);
|
|
|
63
63
|
import { create, insert, search } from "@orama/orama";
|
|
64
64
|
|
|
65
65
|
// src/vector.ts
|
|
66
|
-
import { pipeline } from "@xenova/transformers";
|
|
67
66
|
var embedder = null;
|
|
68
67
|
var initVectorEngine = async () => {
|
|
69
68
|
if (embedder) return;
|
|
70
69
|
console.log("> Initializing Browser Vector Engine...");
|
|
70
|
+
const { pipeline } = await import("@huggingface/transformers");
|
|
71
71
|
embedder = await pipeline("feature-extraction", "Xenova/all-MiniLM-L6-v2");
|
|
72
72
|
};
|
|
73
73
|
var generateEmbedding = async (text) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forbocai/browser",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"description": "Web Browser implementation for ForbocAI SDK",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
"test": "vitest"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@forbocai/core": "^0.
|
|
15
|
+
"@forbocai/core": "^0.5.1",
|
|
16
16
|
"@mlc-ai/web-llm": "^0.2.46",
|
|
17
17
|
"@orama/orama": "^2.0.26",
|
|
18
|
-
"@
|
|
18
|
+
"@huggingface/transformers": "^3.0.0"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"tsup": "^8.5.1",
|