@epfml/discojs-node 3.0.1-p20260605114540.0 → 3.0.1-p20260618084023.0
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/hellaswag.d.ts +1 -1
- package/dist/hellaswag.d.ts.map +1 -1
- package/dist/hellaswag.js +6 -6
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/loaders/index.d.ts +1 -1
- package/dist/loaders/index.d.ts.map +1 -1
- package/dist/loaders/index.js +1 -1
- package/dist/loaders/text.js +3 -3
- package/package.json +31 -31
package/dist/hellaswag.d.ts
CHANGED
package/dist/hellaswag.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hellaswag.d.ts","sourceRoot":"","sources":["../src/hellaswag.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AASxC;;;;;GAKG;AACH,wBAAsB,IAAI,CAAC,KAAK,SAAK,GAAG,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,
|
|
1
|
+
{"version":3,"file":"hellaswag.d.ts","sourceRoot":"","sources":["../src/hellaswag.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AASxC;;;;;GAKG;AACH,wBAAsB,IAAI,CAAC,KAAK,SAAK,GAAG,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAuCvE"}
|
package/dist/hellaswag.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import fetch from
|
|
3
|
-
import fs from
|
|
4
|
-
import { models } from
|
|
5
|
-
import { dirname } from
|
|
6
|
-
import { fileURLToPath } from
|
|
2
|
+
import fetch from "node-fetch";
|
|
3
|
+
import fs from "node:fs/promises";
|
|
4
|
+
import { models } from "@epfml/discojs";
|
|
5
|
+
import { dirname } from "path";
|
|
6
|
+
import { fileURLToPath } from "url";
|
|
7
7
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
8
8
|
const DATASET_DIR = path.join(__dirname, "..", "..", "datasets");
|
|
9
9
|
const hellaswag_filepath = path.join(DATASET_DIR, "hellaswag_val.jsonl");
|
|
@@ -30,7 +30,7 @@ export async function load(limit = -1) {
|
|
|
30
30
|
// Save the file locally
|
|
31
31
|
await fs.writeFile(hellaswag_filepath, text);
|
|
32
32
|
}
|
|
33
|
-
const lines = text.split(
|
|
33
|
+
const lines = text.split("\n");
|
|
34
34
|
const dataset = [];
|
|
35
35
|
let count = 0;
|
|
36
36
|
for (const line of lines) {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export { saveModelToDisk, loadModelFromDisk } from
|
|
3
|
-
export { load as loadHellaSwag } from
|
|
1
|
+
export * from "./loaders/index.js";
|
|
2
|
+
export { saveModelToDisk, loadModelFromDisk } from "./model_loader.js";
|
|
3
|
+
export { load as loadHellaSwag } from "./hellaswag.js";
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export { saveModelToDisk, loadModelFromDisk } from
|
|
3
|
-
export { load as loadHellaSwag } from
|
|
1
|
+
export * from "./loaders/index.js";
|
|
2
|
+
export { saveModelToDisk, loadModelFromDisk } from "./model_loader.js";
|
|
3
|
+
export { load as loadHellaSwag } from "./hellaswag.js";
|
package/dist/loaders/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { load as loadCSV } from "./csv.js";
|
|
2
|
-
export { load as loadImage, loadAllInDir as loadImagesInDir
|
|
2
|
+
export { load as loadImage, loadAllInDir as loadImagesInDir } from "./image.js";
|
|
3
3
|
export { load as loadText } from "./text.js";
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/loaders/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/loaders/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,YAAY,IAAI,eAAe,EAAE,MAAM,YAAY,CAAC;AAChF,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/loaders/index.js
CHANGED
package/dist/loaders/text.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import createDebug from "debug";
|
|
2
|
-
import { createReadStream } from
|
|
2
|
+
import { createReadStream } from "node:fs";
|
|
3
3
|
import { Dataset } from "@epfml/discojs";
|
|
4
4
|
const debug = createDebug("discojs-node:loaders:text");
|
|
5
5
|
/**
|
|
@@ -14,8 +14,8 @@ export function load(path) {
|
|
|
14
14
|
// Create a stream to read the text file chunk by chunk
|
|
15
15
|
const stream = createReadStream(path, { encoding: "utf8" });
|
|
16
16
|
for await (const chunk of stream) {
|
|
17
|
-
if (typeof chunk !==
|
|
18
|
-
throw new Error(
|
|
17
|
+
if (typeof chunk !== "string")
|
|
18
|
+
throw new Error("Expected file stream to yield string");
|
|
19
19
|
debug("yield chunk of length: %o", chunk.length);
|
|
20
20
|
yield chunk;
|
|
21
21
|
}
|
package/package.json
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
2
|
+
"name": "@epfml/discojs-node",
|
|
3
|
+
"version": "3.0.1-p20260618084023.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"exports": "./dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"watch": "nodemon --ext ts --ignore dist --watch ../discojs/dist --watch . --exec npm run",
|
|
9
|
+
"build": "tsc --build",
|
|
10
|
+
"test": "cd .. && vitest --run --project=discojs-node"
|
|
11
|
+
},
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git+https://github.com/epfml/disco.git"
|
|
15
|
+
},
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/epfml/disco/issues"
|
|
18
|
+
},
|
|
19
|
+
"homepage": "https://github.com/epfml/disco#readme",
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@epfml/discojs": "*",
|
|
22
|
+
"@roamhq/wrtc": "0.10",
|
|
23
|
+
"@tensorflow/tfjs-node": "4",
|
|
24
|
+
"csv-parse": "6",
|
|
25
|
+
"sharp": "0.34"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@types/node": "22",
|
|
29
|
+
"nodemon": "3",
|
|
30
|
+
"tmp-promise": "3",
|
|
31
|
+
"ts-node": "10"
|
|
32
|
+
}
|
|
33
33
|
}
|