@genai-fi/nanogpt 0.20.6 → 0.21.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/{BaseTokeniser-DSg9zcYq.js → BaseTokeniser-C9TSv4th.js} +1 -1
- package/dist/{DatasetBuilder-DgURD85T.js → DatasetBuilder-B9UGNQT5.js} +82 -88
- package/dist/Generator.js +1 -1
- package/dist/{RealDiv-DBu0FQqT.js → RealDiv-CNsvC4AU.js} +6 -6
- package/dist/{Reshape-DqO3r8BC.js → Reshape-CwxdaU8n.js} +1 -1
- package/dist/{Reshape-CABOPB9d.js → Reshape-dnm9bO3B.js} +2 -2
- package/dist/TeachableLLM.js +1 -1
- package/dist/Trainer.js +1 -1
- package/dist/backend.js +2 -2
- package/dist/{backend_util-Cg-roD1p.js → backend_util-DAV0I34P.js} +5 -5
- package/dist/checks/appendCache.js +1 -1
- package/dist/checks/attentionMask.js +1 -1
- package/dist/checks/gelu.js +1 -1
- package/dist/checks/matMulGelu.js +1 -1
- package/dist/checks/normRMS.js +1 -1
- package/dist/checks/normRMSGrad.js +1 -1
- package/dist/checks/packUnpack.js +1 -1
- package/dist/checks/qkv.js +1 -1
- package/dist/checks/rope.js +6 -6
- package/dist/{chunk-BPntVaq0.js → chunk-CWhphoD1.js} +5 -5
- package/dist/{concat_util-CWDZCBlA.js → concat_util-CWzvQQlK.js} +1 -1
- package/dist/data/docx.js +58 -59
- package/dist/data/pdf.js +1 -1
- package/dist/data/textLoader.js +1 -1
- package/dist/{dist-DVmq73nz.js → dist-9wGF4ci9.js} +10 -10
- package/dist/{dist-VEU5mfO0.js → dist-BqAU9-yi.js} +4 -4
- package/dist/{dist-BewPQWjc.js → dist-Da20xy8E.js} +1874 -3071
- package/dist/{gelu-Bf1HW1RY.js → gelu-B6637MKa.js} +1 -1
- package/dist/{gpgpu_math-DvLcCH6u.js → gpgpu_math-DBYEAAdI.js} +2 -2
- package/dist/{kernel_funcs_utils-HiXOOx3f.js → kernel_funcs_utils-D-mATnGR.js} +3 -3
- package/dist/layers/BaseLayer.js +1 -1
- package/dist/layers/CausalSelfAttention.js +4 -4
- package/dist/layers/LoRA.js +3 -3
- package/dist/layers/MLP.js +2 -2
- package/dist/layers/PositionEmbedding.js +2 -2
- package/dist/layers/RMSNorm.js +1 -1
- package/dist/layers/RoPECache.js +1 -1
- package/dist/layers/TiedEmbedding.js +3 -3
- package/dist/layers/TransformerBlock.js +1 -1
- package/dist/layers/WeightStore.js +3 -3
- package/dist/loader/load.js +1 -1
- package/dist/loader/loadHF.js +1 -1
- package/dist/loader/loadTransformers.js +1 -1
- package/dist/loader/loadZipMeta.js +1 -1
- package/dist/loader/newZipLoad.js +1 -1
- package/dist/loader/oldZipLoad.js +1 -1
- package/dist/loader/save.d.ts +1 -0
- package/dist/loader/save.js +1 -1
- package/dist/{main-C0YUnw98.js → main-DdsoTJAW.js} +2012 -2015
- package/dist/main.js +1 -1
- package/dist/{matMul16-BNfZSnNM.js → matMul16-DGtlziMn.js} +3 -3
- package/dist/{matMulGelu-CPTntosE.js → matMulGelu-BAIgQaRx.js} +3 -3
- package/dist/models/NanoGPTV1.js +1 -1
- package/dist/models/NanoGPTV2.js +1 -1
- package/dist/models/factory.js +1 -1
- package/dist/models/model.js +1 -1
- package/dist/ops/adamAdjust.js +1 -1
- package/dist/ops/adamMoments.js +1 -1
- package/dist/ops/add16.js +1 -1
- package/dist/ops/appendCache.js +1 -1
- package/dist/ops/attentionMask.js +1 -1
- package/dist/ops/concat16.js +1 -1
- package/dist/ops/cpu/adamAdjust.js +1 -1
- package/dist/ops/cpu/adamMoments.js +1 -1
- package/dist/ops/cpu/appendCache.js +1 -1
- package/dist/ops/cpu/attentionMask.js +1 -1
- package/dist/ops/cpu/fusedSoftmax.js +1 -1
- package/dist/ops/cpu/gatherSub.js +1 -1
- package/dist/ops/cpu/gelu.js +1 -1
- package/dist/ops/cpu/matMul16.js +1 -1
- package/dist/ops/cpu/matMulGelu.js +2 -2
- package/dist/ops/cpu/matMulMul.js +1 -1
- package/dist/ops/cpu/mulDropout.js +1 -1
- package/dist/ops/cpu/normRMS.js +1 -1
- package/dist/ops/cpu/qkv.js +1 -1
- package/dist/ops/cpu/rope.js +1 -1
- package/dist/ops/cpu/scatterSub.js +1 -1
- package/dist/ops/dot16.js +2 -2
- package/dist/ops/dropout.js +1 -1
- package/dist/ops/dropout16.js +1 -1
- package/dist/ops/gatherSub.js +1 -1
- package/dist/ops/gelu.js +1 -1
- package/dist/ops/globalNorm.js +1 -1
- package/dist/ops/grads/add16.js +1 -1
- package/dist/ops/grads/attentionMask.js +2 -2
- package/dist/ops/grads/gelu.js +1 -1
- package/dist/ops/grads/matMul16.js +1 -1
- package/dist/ops/grads/matMulGelu.js +1 -1
- package/dist/ops/grads/normRMS.js +1 -1
- package/dist/ops/grads/pack16.js +1 -1
- package/dist/ops/grads/qkv.js +2 -2
- package/dist/ops/grads/rope.js +1 -1
- package/dist/ops/grads/softmax16.js +1 -1
- package/dist/ops/grads/unpack16.js +1 -1
- package/dist/ops/matMul16.js +1 -1
- package/dist/ops/matMulGelu.js +2 -2
- package/dist/ops/matMulMul.js +1 -1
- package/dist/ops/mul16.js +1 -1
- package/dist/ops/mulDrop.js +1 -1
- package/dist/ops/normRMS.js +1 -1
- package/dist/ops/pack16.js +1 -1
- package/dist/ops/qkv.js +1 -1
- package/dist/ops/reshape16.js +1 -1
- package/dist/ops/rope.js +1 -1
- package/dist/ops/scatterSub.js +1 -1
- package/dist/ops/slice16.js +1 -1
- package/dist/ops/softmax16.js +1 -1
- package/dist/ops/sub16.js +1 -1
- package/dist/ops/sum16.js +1 -1
- package/dist/ops/transpose16.js +1 -1
- package/dist/ops/unpack16.js +1 -1
- package/dist/ops/webgl/adamAdjust.js +2 -2
- package/dist/ops/webgl/adamMoments.js +3 -3
- package/dist/ops/webgl/appendCache.js +1 -1
- package/dist/ops/webgl/attentionMask.js +1 -1
- package/dist/ops/webgl/dropout16.js +1 -1
- package/dist/ops/webgl/fusedSoftmax.js +3 -3
- package/dist/ops/webgl/gatherSub.js +1 -1
- package/dist/ops/webgl/gelu.js +2 -2
- package/dist/ops/webgl/log.js +3 -3
- package/dist/ops/webgl/matMul16.js +8 -4
- package/dist/ops/webgl/matMulGelu.js +1 -1
- package/dist/ops/webgl/matMulMul.js +2 -2
- package/dist/ops/webgl/mulDropout.js +1 -1
- package/dist/ops/webgl/normRMS.js +1 -1
- package/dist/ops/webgl/qkv.js +1 -1
- package/dist/ops/webgl/rope.js +1 -1
- package/dist/ops/webgl/scatterSub.js +1 -1
- package/dist/ops/webgpu/adamAdjust.js +3 -3
- package/dist/ops/webgpu/adamMoments.js +3 -3
- package/dist/ops/webgpu/add16.js +1 -1
- package/dist/ops/webgpu/appendCache.js +3 -3
- package/dist/ops/webgpu/attentionMask.js +2 -2
- package/dist/ops/webgpu/attentionMask32_program.js +2 -2
- package/dist/ops/webgpu/clipScale.js +1 -1
- package/dist/ops/webgpu/concat16.js +5 -5
- package/dist/ops/webgpu/dropout16.js +3 -3
- package/dist/ops/webgpu/gatherSub.js +3 -3
- package/dist/ops/webgpu/gelu.js +3 -3
- package/dist/ops/webgpu/matMul16.js +8 -4
- package/dist/ops/webgpu/matMul16_program.js +7 -7
- package/dist/ops/webgpu/mul16.js +1 -1
- package/dist/ops/webgpu/norm2.js +1 -1
- package/dist/ops/webgpu/normRMS.js +3 -3
- package/dist/ops/webgpu/normRMSGrad.js +4 -4
- package/dist/ops/webgpu/pack16.js +1 -1
- package/dist/ops/webgpu/pack16_program.js +2 -2
- package/dist/ops/webgpu/qkv.js +2 -2
- package/dist/ops/webgpu/rope.js +3 -3
- package/dist/ops/webgpu/scatterSub.js +3 -3
- package/dist/ops/webgpu/slice16.js +4 -4
- package/dist/ops/webgpu/softmax16.js +1 -1
- package/dist/ops/webgpu/softmax16_program.js +2 -2
- package/dist/ops/webgpu/softmax16_subgroup_program.js +2 -2
- package/dist/ops/webgpu/softmax16grad.js +1 -1
- package/dist/ops/webgpu/sub16.js +1 -1
- package/dist/ops/webgpu/sum16.js +15 -15
- package/dist/ops/webgpu/transpose16.js +1 -1
- package/dist/ops/webgpu/transpose16_program.js +2 -2
- package/dist/ops/webgpu/transpose16_shared_program.js +3 -3
- package/dist/ops/webgpu/unpack16.js +3 -3
- package/dist/ops/webgpu/utils/binary_op.js +3 -3
- package/dist/ops/webgpu/utils/reductions.js +3 -3
- package/dist/{pack16-Ck-spx_F.js → pack16-BhuXNUS7.js} +1 -1
- package/dist/patches/webgpu_backend.js +3 -3
- package/dist/patches/webgpu_base.js +1 -1
- package/dist/patches/webgpu_program.js +4 -4
- package/dist/{pdf-UoDqCYzz.js → pdf-CdmW8ikl.js} +1159 -1160
- package/dist/{picomatch-3tUnMMbd.js → picomatch-BO4HbNfo.js} +125 -127
- package/dist/{rope-CbeGlsV8.js → rope-C8EAiSGY.js} +1 -1
- package/dist/{selu_util-zkAx5doH.js → selu_util-B_AFEfoz.js} +1 -1
- package/dist/{shared-D1coEFea.js → shared-24EoeHJl.js} +4 -4
- package/dist/{shared-DOgWaqvL.js → shared-CfTzpULd.js} +1 -1
- package/dist/{slice_util-Dgb3ANWI.js → slice_util-Dve4TkDn.js} +2 -2
- package/dist/{tfjs_backend-BjuQ5FqB.js → tfjs_backend-CydPRQTc.js} +2 -2
- package/dist/tokeniser/BaseTokeniser.js +1 -1
- package/dist/tokeniser/CharTokeniser.js +1 -1
- package/dist/tokeniser/bpe.js +1 -1
- package/dist/training/AdamW.js +1 -1
- package/dist/training/BasicTrainer.js +2 -2
- package/dist/training/DatasetBuilder.d.ts +0 -1
- package/dist/training/DatasetBuilder.js +2 -2
- package/dist/training/Evaluator.js +1 -1
- package/dist/training/PreTrainer.js +1 -1
- package/dist/training/SFTTrainer.js +1 -1
- package/dist/training/loss.js +2 -2
- package/dist/training/orthoGrad.js +1 -1
- package/dist/training/sparseCrossEntropy.js +1 -1
- package/dist/training/tasks/ConversationTask.js +1 -1
- package/dist/training/validation.js +1 -1
- package/dist/utilities/arrayClose.d.ts +1 -0
- package/dist/utilities/arrayClose.js +13 -1
- package/dist/utilities/dummy.js +1 -1
- package/dist/utilities/float16.d.ts +3 -0
- package/dist/utilities/float16.js +46 -0
- package/dist/utilities/multinomialCPU.js +1 -1
- package/dist/utilities/packed.js +1 -1
- package/dist/utilities/performance.js +1 -1
- package/dist/utilities/profile.js +1 -1
- package/dist/utilities/safetensors.d.ts +3 -1
- package/dist/utilities/safetensors.js +46 -36
- package/dist/utilities/sentences.js +1 -1
- package/dist/utilities/weights.js +1 -1
- package/dist/{webgpu-Dt7BMzWz.js → webgpu-B19Tw8Nd.js} +3 -3
- package/dist/{webgpu_program-WOyIVMlZ.js → webgpu_program-B0PokuRJ.js} +1 -1
- package/dist/{webgpu_util-B_F3SShA.js → webgpu_util-DfODg6XI.js} +1 -1
- package/package.json +5 -5
- package/dist/dist-DXwIvKxl.js +0 -896
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
//#region \0rolldown/runtime.js
|
|
2
|
-
var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (
|
|
2
|
+
var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), s = (e, n) => {
|
|
3
3
|
let r = {};
|
|
4
4
|
for (var i in e) t(r, i, {
|
|
5
5
|
get: e[i],
|
|
6
6
|
enumerable: !0
|
|
7
7
|
});
|
|
8
8
|
return n || t(r, Symbol.toStringTag, { value: "Module" }), r;
|
|
9
|
-
},
|
|
9
|
+
}, c = (e, i, o, s) => {
|
|
10
10
|
if (i && typeof i == "object" || typeof i == "function") for (var c = r(i), l = 0, u = c.length, d; l < u; l++) d = c[l], !a.call(e, d) && d !== o && t(e, d, {
|
|
11
11
|
get: ((e) => i[e]).bind(null, d),
|
|
12
12
|
enumerable: !(s = n(i, d)) || s.enumerable
|
|
13
13
|
});
|
|
14
14
|
return e;
|
|
15
|
-
},
|
|
15
|
+
}, l = (n, r, a) => (a = n == null ? {} : e(i(n)), c(r || !n || !n.__esModule ? t(a, "default", {
|
|
16
16
|
value: n,
|
|
17
17
|
enumerable: !0
|
|
18
|
-
}) : a, n)),
|
|
18
|
+
}) : a, n)), u = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, t) => (typeof require < "u" ? require : e)[t] }) : e)(function(e) {
|
|
19
19
|
if (typeof require < "u") return require.apply(this, arguments);
|
|
20
20
|
throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
|
|
21
21
|
});
|
|
22
22
|
//#endregion
|
|
23
|
-
export {
|
|
23
|
+
export { l as i, s as n, u as r, o as t };
|
package/dist/data/docx.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as r, i, n as a, o, r as s, t as c } from "../dist-DXwIvKxl.js";
|
|
1
|
+
import { i as e, r as t, t as n } from "../chunk-CWhphoD1.js";
|
|
3
2
|
//#region node_modules/jszip/dist/jszip.min.js
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
typeof e == "object" && n !== void 0 ? n.exports = t() : typeof define == "function" && define.amd ? define([], t) : (typeof window < "u" ? window :
|
|
3
|
+
var r = /* @__PURE__ */ n(((e, n) => {
|
|
4
|
+
(function(t) {
|
|
5
|
+
typeof e == "object" && n !== void 0 ? n.exports = t() : typeof define == "function" && define.amd ? define([], t) : (typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : this).JSZip = t();
|
|
7
6
|
})(function() {
|
|
8
7
|
return function e(n, r, i) {
|
|
9
8
|
function a(s, c) {
|
|
@@ -405,19 +404,19 @@ var l = /* @__PURE__ */ n(((e, n) => {
|
|
|
405
404
|
}],
|
|
406
405
|
14: [function(e, t, n) {
|
|
407
406
|
t.exports = {
|
|
408
|
-
isNode:
|
|
407
|
+
isNode: typeof Buffer < "u",
|
|
409
408
|
newBufferFrom: function(e, t) {
|
|
410
|
-
if (
|
|
409
|
+
if (Buffer.from && Buffer.from !== Uint8Array.from) return Buffer.from(e, t);
|
|
411
410
|
if (typeof e == "number") throw Error("The \"data\" argument must not be a number");
|
|
412
|
-
return new
|
|
411
|
+
return new Buffer(e, t);
|
|
413
412
|
},
|
|
414
413
|
allocBuffer: function(e) {
|
|
415
|
-
if (
|
|
416
|
-
var t = new
|
|
414
|
+
if (Buffer.alloc) return Buffer.alloc(e);
|
|
415
|
+
var t = new Buffer(e);
|
|
417
416
|
return t.fill(0), t;
|
|
418
417
|
},
|
|
419
418
|
isBuffer: function(e) {
|
|
420
|
-
return
|
|
419
|
+
return Buffer.isBuffer(e);
|
|
421
420
|
},
|
|
422
421
|
isStream: function(e) {
|
|
423
422
|
return e && typeof e.on == "function" && typeof e.pause == "function" && typeof e.resume == "function";
|
|
@@ -824,13 +823,13 @@ var l = /* @__PURE__ */ n(((e, n) => {
|
|
|
824
823
|
}, t.exports = r;
|
|
825
824
|
}, {}],
|
|
826
825
|
29: [function(e, t, n) {
|
|
827
|
-
var r = e("../utils"), i = e("./ConvertWorker"), a = e("./GenericWorker"), o = e("../base64"), s = e("../support"),
|
|
826
|
+
var r = e("../utils"), i = e("./ConvertWorker"), a = e("./GenericWorker"), o = e("../base64"), s = e("../support"), c = e("../external"), l = null;
|
|
828
827
|
if (s.nodestream) try {
|
|
829
|
-
|
|
828
|
+
l = e("../nodejs/NodejsStreamOutputAdapter");
|
|
830
829
|
} catch {}
|
|
831
|
-
function
|
|
832
|
-
return new
|
|
833
|
-
var a = [], s = e._internalType,
|
|
830
|
+
function u(e, t) {
|
|
831
|
+
return new c.Promise(function(n, i) {
|
|
832
|
+
var a = [], s = e._internalType, c = e._outputType, l = e._mimeType;
|
|
834
833
|
e.on("data", function(e, n) {
|
|
835
834
|
a.push(e), t && t(n);
|
|
836
835
|
}).on("error", function(e) {
|
|
@@ -843,7 +842,7 @@ var l = /* @__PURE__ */ n(((e, n) => {
|
|
|
843
842
|
case "base64": return o.encode(t);
|
|
844
843
|
default: return r.transformTo(e, t);
|
|
845
844
|
}
|
|
846
|
-
}(
|
|
845
|
+
}(c, function(e, t) {
|
|
847
846
|
var n, r = 0, i = null, a = 0;
|
|
848
847
|
for (n = 0; n < t.length; n++) a += t[n].length;
|
|
849
848
|
switch (e) {
|
|
@@ -852,10 +851,10 @@ var l = /* @__PURE__ */ n(((e, n) => {
|
|
|
852
851
|
case "uint8array":
|
|
853
852
|
for (i = new Uint8Array(a), n = 0; n < t.length; n++) i.set(t[n], r), r += t[n].length;
|
|
854
853
|
return i;
|
|
855
|
-
case "nodebuffer": return
|
|
854
|
+
case "nodebuffer": return Buffer.concat(t);
|
|
856
855
|
default: throw Error("concat : unsupported type '" + e + "'");
|
|
857
856
|
}
|
|
858
|
-
}(s, a),
|
|
857
|
+
}(s, a), l));
|
|
859
858
|
} catch (e) {
|
|
860
859
|
i(e);
|
|
861
860
|
}
|
|
@@ -863,7 +862,7 @@ var l = /* @__PURE__ */ n(((e, n) => {
|
|
|
863
862
|
}).resume();
|
|
864
863
|
});
|
|
865
864
|
}
|
|
866
|
-
function
|
|
865
|
+
function d(e, t, n) {
|
|
867
866
|
var o = t;
|
|
868
867
|
switch (t) {
|
|
869
868
|
case "blob":
|
|
@@ -878,9 +877,9 @@ var l = /* @__PURE__ */ n(((e, n) => {
|
|
|
878
877
|
this._worker = new a("error"), this._worker.error(e);
|
|
879
878
|
}
|
|
880
879
|
}
|
|
881
|
-
|
|
880
|
+
d.prototype = {
|
|
882
881
|
accumulate: function(e) {
|
|
883
|
-
return
|
|
882
|
+
return u(this, e);
|
|
884
883
|
},
|
|
885
884
|
on: function(e, t) {
|
|
886
885
|
var n = this;
|
|
@@ -898,9 +897,9 @@ var l = /* @__PURE__ */ n(((e, n) => {
|
|
|
898
897
|
},
|
|
899
898
|
toNodejsStream: function(e) {
|
|
900
899
|
if (r.checkSupport("nodestream"), this._outputType !== "nodebuffer") throw Error(this._outputType + " is not supported by this method");
|
|
901
|
-
return new
|
|
900
|
+
return new l(this, { objectMode: this._outputType !== "nodebuffer" }, e);
|
|
902
901
|
}
|
|
903
|
-
}, t.exports =
|
|
902
|
+
}, t.exports = d;
|
|
904
903
|
}, {
|
|
905
904
|
"../base64": 1,
|
|
906
905
|
"../external": 6,
|
|
@@ -911,7 +910,7 @@ var l = /* @__PURE__ */ n(((e, n) => {
|
|
|
911
910
|
"./GenericWorker": 28
|
|
912
911
|
}],
|
|
913
912
|
30: [function(e, t, n) {
|
|
914
|
-
if (n.base64 = !0, n.array = !0, n.string = !0, n.arraybuffer = typeof ArrayBuffer < "u" && typeof Uint8Array < "u", n.nodebuffer =
|
|
913
|
+
if (n.base64 = !0, n.array = !0, n.string = !0, n.arraybuffer = typeof ArrayBuffer < "u" && typeof Uint8Array < "u", n.nodebuffer = typeof Buffer < "u", n.uint8array = typeof Uint8Array < "u", typeof ArrayBuffer > "u") n.blob = !1;
|
|
915
914
|
else {
|
|
916
915
|
var r = /* @__PURE__ */ new ArrayBuffer(0);
|
|
917
916
|
try {
|
|
@@ -1427,7 +1426,7 @@ var l = /* @__PURE__ */ n(((e, n) => {
|
|
|
1427
1426
|
t.exports = function(e) {
|
|
1428
1427
|
l.push(e) !== 1 || r || n();
|
|
1429
1428
|
};
|
|
1430
|
-
}).call(this,
|
|
1429
|
+
}).call(this, typeof global < "u" ? global : typeof self < "u" ? self : typeof window < "u" ? window : {});
|
|
1431
1430
|
}, {}],
|
|
1432
1431
|
37: [function(e, t, n) {
|
|
1433
1432
|
var r = e("immediate");
|
|
@@ -2953,10 +2952,10 @@ while (r === s[++i] && r === s[++i] && r === s[++i] && r === s[++i] && r === s[+
|
|
|
2953
2952
|
(function(e) {
|
|
2954
2953
|
(function(e, t) {
|
|
2955
2954
|
if (!e.setImmediate) {
|
|
2956
|
-
var n, r, a, o
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2955
|
+
var n, r, i, a, o = 1, s = {}, c = !1, l = e.document, u = Object.getPrototypeOf && Object.getPrototypeOf(e);
|
|
2956
|
+
u = u && u.setTimeout ? u : e, n = {}.toString.call(e.process) === "[object process]" ? function(e) {
|
|
2957
|
+
process.nextTick(function() {
|
|
2958
|
+
f(e);
|
|
2960
2959
|
});
|
|
2961
2960
|
} : function() {
|
|
2962
2961
|
if (e.postMessage && !e.importScripts) {
|
|
@@ -2965,37 +2964,37 @@ while (r === s[++i] && r === s[++i] && r === s[++i] && r === s[++i] && r === s[+
|
|
|
2965
2964
|
t = !1;
|
|
2966
2965
|
}, e.postMessage("", "*"), e.onmessage = n, t;
|
|
2967
2966
|
}
|
|
2968
|
-
}() ? (
|
|
2969
|
-
e.postMessage(
|
|
2970
|
-
}) : e.MessageChannel ? ((
|
|
2971
|
-
|
|
2967
|
+
}() ? (a = "setImmediate$" + Math.random() + "$", e.addEventListener ? e.addEventListener("message", p, !1) : e.attachEvent("onmessage", p), function(t) {
|
|
2968
|
+
e.postMessage(a + t, "*");
|
|
2969
|
+
}) : e.MessageChannel ? ((i = new MessageChannel()).port1.onmessage = function(e) {
|
|
2970
|
+
f(e.data);
|
|
2972
2971
|
}, function(e) {
|
|
2973
|
-
|
|
2974
|
-
}) :
|
|
2975
|
-
var t =
|
|
2972
|
+
i.port2.postMessage(e);
|
|
2973
|
+
}) : l && "onreadystatechange" in l.createElement("script") ? (r = l.documentElement, function(e) {
|
|
2974
|
+
var t = l.createElement("script");
|
|
2976
2975
|
t.onreadystatechange = function() {
|
|
2977
|
-
|
|
2976
|
+
f(e), t.onreadystatechange = null, r.removeChild(t), t = null;
|
|
2978
2977
|
}, r.appendChild(t);
|
|
2979
2978
|
}) : function(e) {
|
|
2980
|
-
setTimeout(
|
|
2981
|
-
},
|
|
2979
|
+
setTimeout(f, 0, e);
|
|
2980
|
+
}, u.setImmediate = function(e) {
|
|
2982
2981
|
typeof e != "function" && (e = Function("" + e));
|
|
2983
2982
|
for (var t = Array(arguments.length - 1), r = 0; r < t.length; r++) t[r] = arguments[r + 1];
|
|
2984
|
-
return
|
|
2983
|
+
return s[o] = {
|
|
2985
2984
|
callback: e,
|
|
2986
2985
|
args: t
|
|
2987
|
-
}, n(
|
|
2988
|
-
},
|
|
2986
|
+
}, n(o), o++;
|
|
2987
|
+
}, u.clearImmediate = d;
|
|
2989
2988
|
}
|
|
2990
|
-
function
|
|
2991
|
-
delete
|
|
2989
|
+
function d(e) {
|
|
2990
|
+
delete s[e];
|
|
2992
2991
|
}
|
|
2993
|
-
function
|
|
2994
|
-
if (
|
|
2992
|
+
function f(e) {
|
|
2993
|
+
if (c) setTimeout(f, 0, e);
|
|
2995
2994
|
else {
|
|
2996
|
-
var n =
|
|
2995
|
+
var n = s[e];
|
|
2997
2996
|
if (n) {
|
|
2998
|
-
|
|
2997
|
+
c = !0;
|
|
2999
2998
|
try {
|
|
3000
2999
|
(function(e) {
|
|
3001
3000
|
var n = e.callback, r = e.args;
|
|
@@ -3016,31 +3015,31 @@ while (r === s[++i] && r === s[++i] && r === s[++i] && r === s[++i] && r === s[+
|
|
|
3016
3015
|
}
|
|
3017
3016
|
})(n);
|
|
3018
3017
|
} finally {
|
|
3019
|
-
|
|
3018
|
+
d(e), c = !1;
|
|
3020
3019
|
}
|
|
3021
3020
|
}
|
|
3022
3021
|
}
|
|
3023
3022
|
}
|
|
3024
|
-
function
|
|
3025
|
-
t.source === e && typeof t.data == "string" && t.data.indexOf(
|
|
3023
|
+
function p(t) {
|
|
3024
|
+
t.source === e && typeof t.data == "string" && t.data.indexOf(a) === 0 && f(+t.data.slice(a.length));
|
|
3026
3025
|
}
|
|
3027
3026
|
})(typeof self > "u" ? e === void 0 ? this : e : self);
|
|
3028
|
-
}).call(this,
|
|
3027
|
+
}).call(this, typeof global < "u" ? global : typeof self < "u" ? self : typeof window < "u" ? window : {});
|
|
3029
3028
|
}, {}]
|
|
3030
3029
|
}, {}, [10])(10);
|
|
3031
3030
|
});
|
|
3032
|
-
})),
|
|
3033
|
-
async function
|
|
3034
|
-
let t = await (await
|
|
3031
|
+
})), i = /* @__PURE__ */ e(r(), 1);
|
|
3032
|
+
async function a(e) {
|
|
3033
|
+
let t = await (await i.default.loadAsync(e)).file("word/document.xml")?.async("string");
|
|
3035
3034
|
if (!t) throw Error("Failed to load document.xml");
|
|
3036
|
-
return
|
|
3035
|
+
return o(t).split("\n").filter((e) => e.trim().length > 10).map((e) => [{
|
|
3037
3036
|
role: "text",
|
|
3038
3037
|
content: e
|
|
3039
3038
|
}]);
|
|
3040
3039
|
}
|
|
3041
|
-
function
|
|
3040
|
+
function o(e) {
|
|
3042
3041
|
let t = new DOMParser().parseFromString(e, "application/xml");
|
|
3043
3042
|
return Array.from(t.getElementsByTagName("w:t")).map((e) => e.textContent).join("\n");
|
|
3044
3043
|
}
|
|
3045
3044
|
//#endregion
|
|
3046
|
-
export {
|
|
3045
|
+
export { a as loadDOCX, r as t };
|