@genai-fi/nanogpt 1.0.2 → 1.0.3
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/api/responses.js +3 -3
- package/dist/api/training.js +6 -2
- package/dist/data/pdf.js +11 -11
- package/dist/data/textLoader.js +4 -4
- package/dist/loader/loadZipMeta.js +1 -1
- package/dist/models/config.js +1 -1
- package/dist/{pdf-CdmW8ikl.js → pdf-Bzuk68Vy.js} +11047 -8714
- package/package.json +3 -3
package/dist/data/textLoader.js
CHANGED
|
@@ -523,7 +523,7 @@ function d(e) {
|
|
|
523
523
|
}
|
|
524
524
|
async function f(e, t) {
|
|
525
525
|
let u = e.type === "" ? e instanceof File ? d(e.name) : "application/zip" : e.type;
|
|
526
|
-
if (u === "application/parquet") throw Error("
|
|
526
|
+
if (u === "application/parquet") throw Error("unsupported_file_type");
|
|
527
527
|
if (u === "application/pdf") return new i(await n(e, t?.maxSize));
|
|
528
528
|
if (u === "application/vnd.openxmlformats-officedocument.wordprocessingml.document") return new i(await r(e));
|
|
529
529
|
if (u === "application/json") {
|
|
@@ -538,7 +538,7 @@ async function f(e, t) {
|
|
|
538
538
|
role: "text",
|
|
539
539
|
content: JSON.stringify(e)
|
|
540
540
|
}]));
|
|
541
|
-
throw Error("
|
|
541
|
+
throw Error("bad_format");
|
|
542
542
|
}
|
|
543
543
|
if (u === "application/jsonl") return new o(e);
|
|
544
544
|
if (u === "application/zip") return new a(e);
|
|
@@ -550,7 +550,7 @@ async function f(e, t) {
|
|
|
550
550
|
skipEmptyLines: !0,
|
|
551
551
|
delimiter: ",",
|
|
552
552
|
complete: (n) => {
|
|
553
|
-
if (n.errors.length > 0) console.error(n.errors), r(/* @__PURE__ */ Error("
|
|
553
|
+
if (n.errors.length > 0) console.error(n.errors), r(/* @__PURE__ */ Error("bad_format"));
|
|
554
554
|
else {
|
|
555
555
|
let r = c(n.data[0], t?.column || "text");
|
|
556
556
|
e(new i((t?.hasHeader ?? l(n.data[0]) ? n.data.slice(1) : n.data).map((e) => [{
|
|
@@ -568,7 +568,7 @@ async function f(e, t) {
|
|
|
568
568
|
role: "text",
|
|
569
569
|
content: await e.text()
|
|
570
570
|
}]]);
|
|
571
|
-
throw Error(
|
|
571
|
+
throw Error("unsupported_file_type");
|
|
572
572
|
}
|
|
573
573
|
//#endregion
|
|
574
574
|
export { f as default };
|
|
@@ -7,7 +7,7 @@ async function e(e) {
|
|
|
7
7
|
if (t) try {
|
|
8
8
|
n = JSON.parse(t);
|
|
9
9
|
} catch (e) {
|
|
10
|
-
throw console.error(e), Error("
|
|
10
|
+
throw console.error(e), Error("bad_format", { cause: e });
|
|
11
11
|
}
|
|
12
12
|
else console.warn("meta.json not found in the zip archive, using default metadata");
|
|
13
13
|
return n;
|
package/dist/models/config.js
CHANGED
|
@@ -31,7 +31,7 @@ function n(e) {
|
|
|
31
31
|
if (e.windowSize !== void 0 && typeof e.windowSize != "string") throw Error("Invalid config: \"windowSize\" must be a string for GenAI_NanoGPT_v2.");
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
|
-
throw Error("
|
|
34
|
+
throw Error("invalid_model_type");
|
|
35
35
|
}
|
|
36
36
|
//#endregion
|
|
37
37
|
export { e as defaultConfig, n as validateConfig };
|