@genai-fi/nanogpt 1.5.0 → 1.6.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/{DatasetBuilder-DU1G1OKX.js → DatasetBuilder-DRDW8tcM.js} +85 -86
- package/dist/Generator-BcR_14Cj.js +316 -0
- package/dist/{RealDiv-CSnvtN2E.js → RealDiv-Cl8k3YTx.js} +54 -62
- package/dist/{Reshape-BlylqwWy.js → Reshape-CKxKPKqi.js} +9 -12
- package/dist/Reshape-H5zZRgr9.js +16 -0
- package/dist/RoPECache-dYscFINl.js +722 -0
- package/dist/TeachableLLM.js +29 -34
- package/dist/api/beamer.js +5 -6
- package/dist/api/responses.js +11 -12
- package/dist/api/training.js +12 -14
- package/dist/axis_util-rF9RnwKE.js +37 -0
- package/dist/backend.js +5 -6
- package/dist/{backend_util-DAV0I34P.js → backend_util-Cpp0Gwlp.js} +180 -185
- package/dist/{binary_op_util-CrYk9LXL.js → binary_op_util-WY9YIl0q.js} +3 -7
- package/dist/broadcast_to-CGvLNiQ0.js +20 -0
- package/dist/checks/appendCache.js +7 -7
- package/dist/checks/attentionMask.js +9 -8
- package/dist/checks/check.js +1 -2
- package/dist/checks/gelu.js +6 -6
- package/dist/checks/index.js +24 -25
- package/dist/checks/matMulGelu.js +7 -7
- package/dist/checks/normRMS.js +14 -12
- package/dist/checks/normRMSGrad.js +9 -8
- package/dist/checks/packUnpack.js +7 -7
- package/dist/checks/qkv.js +1 -34
- package/dist/checks/rope.js +6 -6
- package/dist/checks/weights.js +1 -2
- package/dist/clip_by_value-D-UX9am5.js +13 -0
- package/dist/complex-Cl904TqN.js +13 -0
- package/dist/{complex_util-CkazZsaH.js → complex_util-BBlPAm-s.js} +1 -2
- package/dist/concat-Oip5acVY.js +14 -0
- package/dist/{concat_util-CWzvQQlK.js → concat_util-CY45Hf4F.js} +2 -3
- package/dist/data/docx.js +3 -4
- package/dist/data/pdf.js +11 -14
- package/dist/data/stream.js +1 -2
- package/dist/data/textLoader.js +16 -15
- package/dist/data-CV_i_H6B.js +11 -0
- package/dist/data.js +5 -12
- package/dist/dist-CMMLi-qO.js +2675 -0
- package/dist/{dist-BGVm64AY.js → dist-DeVH1nGn.js} +1465 -1573
- package/dist/{dist-CwK5S7Ls.js → dist-DyL7qSLJ.js} +2664 -2400
- package/dist/dropout16-CA31Ud5a.js +20 -0
- package/dist/dropout_util-SiFMbFXz.js +22 -0
- package/dist/{eventemitter3-D_qV3Lof.js → eventemitter3-wmfmOP_f.js} +2 -3
- package/dist/expand_dims-Dh3Fulyn.js +10 -0
- package/dist/floor-BwjmUb7X.js +8 -0
- package/dist/gather-B5Z1RFt5.js +14 -0
- package/dist/gatherSub-CRUfUzBa.js +22 -0
- package/dist/gelu-Xx9-ohH9.js +25 -0
- package/dist/{gpgpu_math-20tPK8LM.js → gpgpu_math-48m8q3jI.js} +265 -286
- package/dist/inference/Beamer.js +34 -27
- package/dist/inference/Generator.js +1 -273
- package/dist/inference/tokenisePrompt.js +5 -4
- package/dist/inference/types.d.ts +6 -0
- package/dist/inference/utilities.js +1 -2
- package/dist/{jszip.min-DKa1Rjyn.js → jszip.min-Btv48m44.js} +68 -64
- package/dist/{kernel_funcs_utils-ql8Y8qPn.js → kernel_funcs_utils-BYRpSfV_.js} +39 -42
- package/dist/layers/BaseLayer.js +9 -10
- package/dist/layers/GQA.js +45 -44
- package/dist/layers/HeadLayer.js +13 -13
- package/dist/layers/LoRA.js +17 -20
- package/dist/layers/MHA.d.ts +2 -2
- package/dist/layers/MHA.js +46 -45
- package/dist/layers/MLP.js +22 -21
- package/dist/layers/PositionEmbedding.js +14 -13
- package/dist/layers/RMSNorm.js +14 -13
- package/dist/layers/RoPECache.js +1 -338
- package/dist/layers/TiedEmbedding.js +15 -14
- package/dist/layers/TransformerBlock.d.ts +3 -9
- package/dist/layers/TransformerBlock.js +29 -30
- package/dist/layers/WeightStore.js +4 -5
- package/dist/layers-CFqEip3s.js +13 -0
- package/dist/layers.js +3 -11
- package/dist/loader/load.js +27 -24
- package/dist/loader/loadHF.js +3 -3
- package/dist/loader/loadTransformers.js +5 -6
- package/dist/loader/loadZipMeta.js +1 -2
- package/dist/loader/newZipLoad.js +1 -2
- package/dist/loader/oldZipLoad.js +8 -9
- package/dist/loader/save.js +15 -16
- package/dist/main.js +3281 -3463
- package/dist/{matMul16-CO1QhsRt.js → matMul16-tE26fnhf.js} +29 -27
- package/dist/{matMulGelu-CBoqTZM7.js → matMulGelu-ASUWlKqu.js} +33 -33
- package/dist/mat_mul-R9_DWmIT.js +16 -0
- package/dist/models/Llama.js +48 -49
- package/dist/models/NanoGPTV1.js +53 -54
- package/dist/models/NanoGPTV2.js +48 -49
- package/dist/models/Qwen3.js +48 -49
- package/dist/models/config.js +3 -8
- package/dist/models/factory.js +7 -8
- package/dist/models/model.d.ts +5 -7
- package/dist/models/model.js +1 -2
- package/dist/models-DyBpJJwM.js +13 -0
- package/dist/models.js +6 -14
- package/dist/mul16-C7sqgqik.js +41 -0
- package/dist/non_max_suppression_impl-B0H318rb.js +72 -0
- package/dist/not_equal-Bu3O8rh_.js +67 -0
- package/dist/one_hot-TEMPumJj.js +14 -0
- package/dist/ones-DpPXWa6A.js +13 -0
- package/dist/ops/adamAdjust.js +2 -3
- package/dist/ops/adamMoments.js +2 -3
- package/dist/ops/add16.js +2 -3
- package/dist/ops/appendCache.js +9 -8
- package/dist/ops/attentionMask.d.ts +1 -1
- package/dist/ops/attentionMask.js +8 -5
- package/dist/ops/concat16.js +5 -5
- package/dist/ops/cpu/adamAdjust.js +7 -8
- package/dist/ops/cpu/adamMoments.js +5 -5
- package/dist/ops/cpu/appendCache.js +3 -3
- package/dist/ops/cpu/attentionMask.js +12 -8
- package/dist/ops/cpu/fusedSoftmax.js +3 -3
- package/dist/ops/cpu/gatherSub.js +1 -12
- package/dist/ops/cpu/gelu.js +12 -13
- package/dist/ops/cpu/matMul16.js +7 -7
- package/dist/ops/cpu/matMulGelu.js +21 -18
- package/dist/ops/cpu/matMulMul.js +8 -9
- package/dist/ops/cpu/mulDropout.js +8 -9
- package/dist/ops/cpu/normRMS.js +12 -13
- package/dist/ops/cpu/qkv.js +14 -13
- package/dist/ops/cpu/rope.js +11 -8
- package/dist/ops/cpu/scatterSub.js +1 -12
- package/dist/ops/dot16.js +16 -17
- package/dist/ops/dropout.js +9 -8
- package/dist/ops/dropout16.js +1 -22
- package/dist/ops/gatherSub.js +3 -4
- package/dist/ops/gelu.js +1 -2
- package/dist/ops/globalNorm.js +10 -10
- package/dist/ops/grads/add16.js +16 -17
- package/dist/ops/grads/attentionMask.js +6 -7
- package/dist/ops/grads/dropout16.js +1 -1
- package/dist/ops/grads/gelu.js +1 -2
- package/dist/ops/grads/matMul16.js +1 -2
- package/dist/ops/grads/matMulGelu.js +6 -7
- package/dist/ops/grads/mul16.js +1 -1
- package/dist/ops/grads/normRMS.js +8 -9
- package/dist/ops/grads/pack16.js +1 -2
- package/dist/ops/grads/qkv.js +10 -10
- package/dist/ops/grads/rope.js +1 -2
- package/dist/ops/grads/silu.js +1 -2
- package/dist/ops/grads/softmax16.js +6 -7
- package/dist/ops/grads/unpack16.js +1 -2
- package/dist/ops/grads/utils.js +1 -2
- package/dist/ops/matMul16.d.ts +1 -1
- package/dist/ops/matMul16.js +1 -2
- package/dist/ops/matMulGelu.js +3 -4
- package/dist/ops/matMulMul.js +2 -3
- package/dist/ops/mul16.js +1 -43
- package/dist/ops/mulDrop.js +2 -3
- package/dist/ops/normRMS.js +2 -3
- package/dist/ops/pack16.js +1 -2
- package/dist/ops/qkv.js +2 -3
- package/dist/ops/reshape16.js +11 -11
- package/dist/ops/rope.js +1 -2
- package/dist/ops/scatterSub.js +3 -4
- package/dist/ops/silu.js +1 -2
- package/dist/ops/slice16.js +5 -5
- package/dist/ops/softmax16.js +3 -4
- package/dist/ops/sub16.js +3 -4
- package/dist/ops/sum16.js +3 -3
- package/dist/ops/transpose16.js +16 -15
- package/dist/ops/unpack16.js +1 -2
- package/dist/ops/webgl/adamAdjust.js +8 -9
- package/dist/ops/webgl/adamMoments.js +2 -3
- package/dist/ops/webgl/appendCache.js +2 -3
- package/dist/ops/webgl/attentionMask.js +2 -3
- package/dist/ops/webgl/dropout16.js +2 -3
- package/dist/ops/webgl/fusedSoftmax.js +13 -13
- package/dist/ops/webgl/gatherSub.js +2 -3
- package/dist/ops/webgl/gelu.js +11 -12
- package/dist/ops/webgl/log.js +10 -10
- package/dist/ops/webgl/matMul16.js +31 -24
- package/dist/ops/webgl/matMulGelu.js +1 -2
- package/dist/ops/webgl/matMulMul.js +3 -4
- package/dist/ops/webgl/mulDropout.js +2 -3
- package/dist/ops/webgl/normRMS.js +11 -10
- package/dist/ops/webgl/qkv.js +2 -3
- package/dist/ops/webgl/rope.js +4 -5
- package/dist/ops/webgl/scatterSub.js +2 -3
- package/dist/ops/webgpu/adamAdjust.js +13 -14
- package/dist/ops/webgpu/adamMoments.js +13 -14
- package/dist/ops/webgpu/add16.js +3 -4
- package/dist/ops/webgpu/appendCache.js +20 -21
- package/dist/ops/webgpu/attentionMask.js +18 -19
- package/dist/ops/webgpu/attentionMask32_program.js +7 -8
- package/dist/ops/webgpu/clipScale.js +11 -12
- package/dist/ops/webgpu/concat16.js +17 -18
- package/dist/ops/webgpu/dropout16.js +6 -7
- package/dist/ops/webgpu/gatherSub.js +11 -12
- package/dist/ops/webgpu/gelu.js +10 -11
- package/dist/ops/webgpu/index.js +17 -17
- package/dist/ops/webgpu/matMul16.js +74 -63
- package/dist/ops/webgpu/matMul16_program.d.ts +2 -1
- package/dist/ops/webgpu/matMul16_program.js +29 -21
- package/dist/ops/webgpu/mul16.js +3 -4
- package/dist/ops/webgpu/norm2.js +9 -10
- package/dist/ops/webgpu/normRMS.js +9 -10
- package/dist/ops/webgpu/normRMS16_program.js +1 -2
- package/dist/ops/webgpu/normRMS32_program.js +1 -2
- package/dist/ops/webgpu/normRMSGrad.js +30 -30
- package/dist/ops/webgpu/pack16.js +2 -3
- package/dist/ops/webgpu/pack16_program.js +3 -4
- package/dist/ops/webgpu/qkv.js +10 -11
- package/dist/ops/webgpu/rope.js +26 -27
- package/dist/ops/webgpu/scatterSub.js +12 -13
- package/dist/ops/webgpu/silu.js +10 -11
- package/dist/ops/webgpu/slice16.js +17 -18
- package/dist/ops/webgpu/softmax16.js +9 -9
- package/dist/ops/webgpu/softmax16_program.js +9 -10
- package/dist/ops/webgpu/softmax16_subgroup_program.js +11 -12
- package/dist/ops/webgpu/softmax16grad.js +8 -9
- package/dist/ops/webgpu/sub16.js +3 -4
- package/dist/ops/webgpu/sum16.js +16 -15
- package/dist/ops/webgpu/transpose16.js +13 -12
- package/dist/ops/webgpu/transpose16_program.js +3 -4
- package/dist/ops/webgpu/transpose16_shared_program.js +17 -18
- package/dist/ops/webgpu/unpack16.js +8 -9
- package/dist/ops/webgpu/utils/binary_op.js +20 -21
- package/dist/ops/webgpu/utils/deviceInfo.js +1 -2
- package/dist/ops/webgpu/utils/reductions.js +21 -20
- package/dist/ops-Be5ACU5R.js +13 -0
- package/dist/ops-C1UpdEYM.js +509 -0
- package/dist/{pack16-BhuXNUS7.js → pack16-BHO4t1-M.js} +14 -17
- package/dist/pad-Dy-1IP3A.js +13 -0
- package/dist/patches/webgpu_backend.js +18 -19
- package/dist/patches/webgpu_base.js +2 -3
- package/dist/patches/webgpu_program.js +21 -22
- package/dist/{pdf-Bzuk68Vy.js → pdf-CbnQ75VG.js} +380 -701
- package/dist/{picomatch-BO4HbNfo.js → picomatch--TW6gyBJ.js} +229 -291
- package/dist/qkv-BQfNPucX.js +42 -0
- package/dist/rand_util-_vCY93Uw.js +44 -0
- package/dist/random_normal-DUIT8kyC.js +11 -0
- package/dist/range-CYvQC3fW.js +13 -0
- package/dist/relu-C4XULT8A.js +8 -0
- package/dist/reshape-DJb1jgMt.js +8 -0
- package/dist/resize_nearest_neighbor-DAqcTYUe.js +188 -0
- package/dist/{chunk-CWhphoD1.js → rolldown-runtime-CwxnZyOB.js} +4 -5
- package/dist/{rope-BPu_uooz.js → rope-JjBVufF_.js} +6 -8
- package/dist/scatterSub-BOnqk-uY.js +27 -0
- package/dist/scatter_nd_util-BepMCpLY.js +34 -0
- package/dist/seedrandom-SHEGFK6H.js +282 -0
- package/dist/selu_util-DeOTf-sc.js +27 -0
- package/dist/shared-BIDMUBCs.js +1864 -0
- package/dist/{shared-CfTzpULd.js → shared-CX_iPI5K.js} +2 -3
- package/dist/silu-DsAE2cJ5.js +23 -0
- package/dist/slice-Dlb1FlzG.js +13 -0
- package/dist/{slice_util-Dve4TkDn.js → slice_util-BVgPRoij.js} +3 -4
- package/dist/softmax-Dpav_dWw.js +10 -0
- package/dist/split-DYnT8chz.js +11 -0
- package/dist/squeeze-B3XYGAlg.js +9 -0
- package/dist/stack-Dbbt9mIk.js +10 -0
- package/dist/step-DA-5DNu9.js +348 -0
- package/dist/{stream-BpAwcvHz.js → stream-BBe2apn4.js} +68 -88
- package/dist/sum-C8qNbFNp.js +13 -0
- package/dist/tensor-ALxWZfmz.js +7 -0
- package/dist/tensor1d-BHgkkhTE.js +9 -0
- package/dist/tensor2d-ARItvqVn.js +10 -0
- package/dist/tensor4d-D1zRBipJ.js +10 -0
- package/dist/tfjs_backend-CsXOum0h.js +685 -0
- package/dist/tile-DfyQ0KX-.js +10 -0
- package/dist/tokenise-DbS2Ea-T.js +14 -0
- package/dist/tokenise.js +6 -15
- package/dist/tokeniser/BaseTokeniser.js +5 -9
- package/dist/tokeniser/CharTokeniser.js +1 -2
- package/dist/tokeniser/bpe.js +19 -20
- package/dist/topk-BrU2pkrR.js +19 -0
- package/dist/training/AdamW.js +35 -31
- package/dist/training/BasicTrainer.js +56 -56
- package/dist/training/DatasetBuilder.js +1 -2
- package/dist/training/Evaluator.js +4 -4
- package/dist/training/LRScheduler.js +1 -2
- package/dist/training/PreTrainer.js +7 -8
- package/dist/training/SFTTrainer.js +7 -8
- package/dist/training/configure.js +16 -15
- package/dist/training/factory.js +1 -2
- package/dist/training/loss.js +1 -2
- package/dist/training/orthoGrad.js +2 -3
- package/dist/training/prepareData.js +18 -17
- package/dist/training/sparseCrossEntropy.js +38 -32
- package/dist/training/tasks/TokenStore.js +21 -22
- package/dist/training/tasks/tokenStream.js +1 -2
- package/dist/training/validateOptions.js +1 -2
- package/dist/training/validation.js +1 -2
- package/dist/transpose-BC-M_OoT.js +34 -0
- package/dist/unsorted_segment_sum-BelC7R-q.js +408 -0
- package/dist/utilities/arrayClose.js +5 -4
- package/dist/utilities/arrayShape.js +1 -2
- package/dist/utilities/datasetID.js +1 -2
- package/dist/utilities/dummy.js +15 -15
- package/dist/utilities/float16.js +10 -10
- package/dist/utilities/maxHeap.js +1 -2
- package/dist/utilities/multinomialCPU.d.ts +1 -2
- package/dist/utilities/multinomialCPU.js +6 -8
- package/dist/utilities/packed.js +2 -3
- package/dist/utilities/parameters.js +3 -4
- package/dist/utilities/performance.js +2 -3
- package/dist/utilities/profile.js +3 -4
- package/dist/utilities/random.js +1 -2
- package/dist/utilities/safetensors.js +14 -14
- package/dist/utilities/sentences.js +16 -13
- package/dist/utilities/tokenParse.js +1 -2
- package/dist/utilities/tokens.js +5 -6
- package/dist/utilities/topP.d.ts +1 -0
- package/dist/utilities/topP.js +20 -13
- package/dist/utilities/waitForModel.js +1 -2
- package/dist/utilities/weights.js +4 -4
- package/dist/utilities/yielder.js +1 -2
- package/dist/{v4-BK7K-jy_.js → v4-YCkfo8OR.js} +4 -7
- package/dist/{webgpu-IAn9VotJ.js → webgpu-BHX-uBym.js} +156 -163
- package/dist/{webgpu_program-B0PokuRJ.js → webgpu_program-DvkFqRlR.js} +28 -29
- package/dist/{webgpu_util-DfODg6XI.js → webgpu_util-5QTyovaf.js} +2 -3
- package/dist/zeros-hxKGkRfl.js +12 -0
- package/package.json +3 -3
- package/dist/Reshape-CwxdaU8n.js +0 -17
- package/dist/dist-Da20xy8E.js +0 -6375
- package/dist/gelu-B6637MKa.js +0 -27
- package/dist/selu_util-B_AFEfoz.js +0 -24
- package/dist/shared-24EoeHJl.js +0 -1314
- package/dist/silu-B6bvCgJ7.js +0 -25
- package/dist/tfjs_backend-h5weiy1O.js +0 -614
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { H as e, J as t } from "../dist-CMMLi-qO.js";
|
|
2
|
+
import { t as n } from "../tensor2d-ARItvqVn.js";
|
|
3
|
+
import { t as r } from "../tensor4d-D1zRBipJ.js";
|
|
4
|
+
// lib/checks/attentionMask.ts
|
|
3
5
|
async function i(i) {
|
|
4
|
-
await
|
|
5
|
-
let a =
|
|
6
|
+
await t(i);
|
|
7
|
+
let a = r([[[[
|
|
6
8
|
.1,
|
|
7
9
|
.2,
|
|
8
10
|
.3,
|
|
@@ -17,7 +19,7 @@ async function i(i) {
|
|
|
17
19
|
1,
|
|
18
20
|
2,
|
|
19
21
|
4
|
|
20
|
-
]), o =
|
|
22
|
+
]), o = r([[[[
|
|
21
23
|
.5,
|
|
22
24
|
.6,
|
|
23
25
|
.5,
|
|
@@ -32,7 +34,7 @@ async function i(i) {
|
|
|
32
34
|
1,
|
|
33
35
|
2,
|
|
34
36
|
4
|
|
35
|
-
]), s =
|
|
37
|
+
]), s = n([[
|
|
36
38
|
0,
|
|
37
39
|
-Infinity,
|
|
38
40
|
-Infinity,
|
|
@@ -43,7 +45,7 @@ async function i(i) {
|
|
|
43
45
|
0,
|
|
44
46
|
-Infinity
|
|
45
47
|
]], [2, 4]);
|
|
46
|
-
return await
|
|
48
|
+
return await e().runKernel("AttentionMask", {
|
|
47
49
|
q: a,
|
|
48
50
|
k: o,
|
|
49
51
|
mask: s
|
|
@@ -52,5 +54,4 @@ async function i(i) {
|
|
|
52
54
|
pastLen: 0
|
|
53
55
|
}).array();
|
|
54
56
|
}
|
|
55
|
-
//#endregion
|
|
56
57
|
export { i as execute };
|
package/dist/checks/check.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { arraysClose as e } from "../utilities/arrayClose.js";
|
|
2
|
-
|
|
2
|
+
// lib/checks/check.ts
|
|
3
3
|
async function t(t, n, r) {
|
|
4
4
|
let i = r ?? [
|
|
5
5
|
"cpu",
|
|
@@ -28,5 +28,4 @@ async function t(t, n, r) {
|
|
|
28
28
|
}
|
|
29
29
|
return o;
|
|
30
30
|
}
|
|
31
|
-
//#endregion
|
|
32
31
|
export { t as default };
|
package/dist/checks/gelu.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { H as e, J as t } from "../dist-CMMLi-qO.js";
|
|
2
|
+
import { t as n } from "../tensor2d-ARItvqVn.js";
|
|
3
|
+
// lib/checks/gelu.ts
|
|
3
4
|
async function r(r) {
|
|
4
|
-
await
|
|
5
|
-
let i =
|
|
5
|
+
await t(r);
|
|
6
|
+
let i = n([
|
|
6
7
|
[
|
|
7
8
|
.1,
|
|
8
9
|
.2,
|
|
@@ -40,7 +41,6 @@ async function r(r) {
|
|
|
40
41
|
0
|
|
41
42
|
]
|
|
42
43
|
], [4, 7]);
|
|
43
|
-
return await
|
|
44
|
+
return await e().runKernel("Gelu", { x: i }).array();
|
|
44
45
|
}
|
|
45
|
-
//#endregion
|
|
46
46
|
export { r as execute };
|
package/dist/checks/index.js
CHANGED
|
@@ -1,28 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { execute as
|
|
3
|
-
import {
|
|
4
|
-
import { execute as
|
|
5
|
-
import { execute as
|
|
6
|
-
import { execute as
|
|
7
|
-
import { execute as
|
|
8
|
-
import { execute as
|
|
9
|
-
import { execute as
|
|
10
|
-
import
|
|
11
|
-
import d from "./
|
|
12
|
-
|
|
1
|
+
import { execute as e } from "./rope.js";
|
|
2
|
+
import { execute as t } from "./normRMS.js";
|
|
3
|
+
import { t as n } from "../qkv-BQfNPucX.js";
|
|
4
|
+
import { execute as r } from "./gelu.js";
|
|
5
|
+
import { execute as i } from "./normRMSGrad.js";
|
|
6
|
+
import { execute as a } from "./appendCache.js";
|
|
7
|
+
import { execute as o } from "./attentionMask.js";
|
|
8
|
+
import { execute as s } from "./matMulGelu.js";
|
|
9
|
+
import { execute as c } from "./packUnpack.js";
|
|
10
|
+
import l from "./check.js";
|
|
11
|
+
import { createTensorStatistics as u, createWeightStatistics as d } from "./weights.js";
|
|
12
|
+
// lib/checks/index.ts
|
|
13
13
|
var f = {
|
|
14
|
-
rope:
|
|
15
|
-
qkv:
|
|
16
|
-
gelu:
|
|
17
|
-
normRMS:
|
|
18
|
-
normRMSGrad:
|
|
19
|
-
appendCache:
|
|
20
|
-
attentionMask:
|
|
21
|
-
matMulGelu:
|
|
22
|
-
packUnpack:
|
|
23
|
-
runCheck:
|
|
24
|
-
createLayerWeightStatistics:
|
|
25
|
-
createWeightStatistics:
|
|
14
|
+
rope: e,
|
|
15
|
+
qkv: n,
|
|
16
|
+
gelu: r,
|
|
17
|
+
normRMS: t,
|
|
18
|
+
normRMSGrad: i,
|
|
19
|
+
appendCache: a,
|
|
20
|
+
attentionMask: o,
|
|
21
|
+
matMulGelu: s,
|
|
22
|
+
packUnpack: c,
|
|
23
|
+
runCheck: l,
|
|
24
|
+
createLayerWeightStatistics: d,
|
|
25
|
+
createWeightStatistics: u
|
|
26
26
|
};
|
|
27
|
-
//#endregion
|
|
28
27
|
export { f as default };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { H as e, J as t } from "../dist-CMMLi-qO.js";
|
|
2
|
+
import { t as n } from "../tensor2d-ARItvqVn.js";
|
|
3
|
+
// lib/checks/matMulGelu.ts
|
|
3
4
|
async function r(r) {
|
|
4
|
-
await
|
|
5
|
-
let i =
|
|
5
|
+
await t(r);
|
|
6
|
+
let i = n([
|
|
6
7
|
[
|
|
7
8
|
.1,
|
|
8
9
|
.2,
|
|
@@ -38,7 +39,7 @@ async function r(r) {
|
|
|
38
39
|
-10,
|
|
39
40
|
-11
|
|
40
41
|
]
|
|
41
|
-
], [5, 5]), a =
|
|
42
|
+
], [5, 5]), a = n([
|
|
42
43
|
[
|
|
43
44
|
.5,
|
|
44
45
|
.6,
|
|
@@ -75,10 +76,9 @@ async function r(r) {
|
|
|
75
76
|
0
|
|
76
77
|
]
|
|
77
78
|
], [5, 5]);
|
|
78
|
-
return await
|
|
79
|
+
return await e().runKernel("MatMulGelu", {
|
|
79
80
|
x: a,
|
|
80
81
|
kernel: i
|
|
81
82
|
}).array();
|
|
82
83
|
}
|
|
83
|
-
//#endregion
|
|
84
84
|
export { r as execute };
|
package/dist/checks/normRMS.js
CHANGED
|
@@ -1,22 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { H as e, J as t, g as n } from "../dist-CMMLi-qO.js";
|
|
2
|
+
import { t as r } from "../tensor-ALxWZfmz.js";
|
|
3
|
+
import { r as i } from "../ops-C1UpdEYM.js";
|
|
4
|
+
import { t as a } from "../tensor1d-BHgkkhTE.js";
|
|
5
|
+
// lib/checks/normRMS.ts
|
|
6
|
+
var o = Array.from({ length: 393216 }, () => Math.random()), s = Array.from({ length: 192 }, () => Math.random()), c = Array.from({ length: 393216 }, () => Math.random());
|
|
4
7
|
async function l(l) {
|
|
5
|
-
await
|
|
6
|
-
let u =
|
|
8
|
+
await t(l);
|
|
9
|
+
let u = a(s, "float32"), d = r(o, [
|
|
7
10
|
16,
|
|
8
11
|
128,
|
|
9
12
|
192
|
|
10
|
-
], "float32"), f =
|
|
13
|
+
], "float32"), f = r(c, [
|
|
11
14
|
16,
|
|
12
15
|
128,
|
|
13
16
|
192
|
|
14
|
-
], "float32"), { value: p, grads: m } =
|
|
15
|
-
let
|
|
16
|
-
x:
|
|
17
|
-
gamma:
|
|
17
|
+
], "float32"), { value: p, grads: m } = n((t, n) => {
|
|
18
|
+
let r = e().runKernel("RMSNorm", {
|
|
19
|
+
x: t,
|
|
20
|
+
gamma: n
|
|
18
21
|
});
|
|
19
|
-
return i.meanSquaredError(
|
|
22
|
+
return i.meanSquaredError(r, f);
|
|
20
23
|
})([d, u]);
|
|
21
24
|
return [
|
|
22
25
|
await p.array(),
|
|
@@ -24,5 +27,4 @@ async function l(l) {
|
|
|
24
27
|
await m[1].array()
|
|
25
28
|
];
|
|
26
29
|
}
|
|
27
|
-
//#endregion
|
|
28
30
|
export { l as execute };
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { H as e, J as t } from "../dist-CMMLi-qO.js";
|
|
2
|
+
import { t as n } from "../tensor-ALxWZfmz.js";
|
|
3
|
+
import { t as r } from "../tensor1d-BHgkkhTE.js";
|
|
4
|
+
// lib/checks/normRMSGrad.ts
|
|
5
|
+
var i = Array.from({ length: 393216 }, () => Math.random()), a = Array.from({ length: 192 }, () => Math.random()), o = Array.from({ length: 393216 }, () => Math.random());
|
|
4
6
|
async function s(s) {
|
|
5
|
-
await
|
|
6
|
-
let c =
|
|
7
|
+
await t(s);
|
|
8
|
+
let c = r(a, "float32"), l = n(i, [
|
|
7
9
|
16,
|
|
8
10
|
128,
|
|
9
11
|
192
|
|
10
|
-
], "float32"), u =
|
|
12
|
+
], "float32"), u = n(o, [
|
|
11
13
|
16,
|
|
12
14
|
128,
|
|
13
15
|
192
|
|
14
|
-
], "float32"), d =
|
|
16
|
+
], "float32"), d = e().runKernel("RMSNormGrad", {
|
|
15
17
|
x: l,
|
|
16
18
|
gamma: c,
|
|
17
19
|
dy: u
|
|
18
20
|
});
|
|
19
21
|
return [await d[0].array(), await d[1].array()];
|
|
20
22
|
}
|
|
21
|
-
//#endregion
|
|
22
23
|
export { s as execute };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { H as e, J as t } from "../dist-CMMLi-qO.js";
|
|
2
|
+
import { t as n } from "../tensor2d-ARItvqVn.js";
|
|
3
|
+
// lib/checks/packUnpack.ts
|
|
3
4
|
async function r(r) {
|
|
4
|
-
await
|
|
5
|
-
let i =
|
|
5
|
+
await t(r);
|
|
6
|
+
let i = n([
|
|
6
7
|
[
|
|
7
8
|
.1,
|
|
8
9
|
.2,
|
|
@@ -39,8 +40,7 @@ async function r(r) {
|
|
|
39
40
|
.001,
|
|
40
41
|
0
|
|
41
42
|
]
|
|
42
|
-
], [4, 7]), a =
|
|
43
|
-
return await
|
|
43
|
+
], [4, 7]), a = e().runKernel("Pack16", { x: i });
|
|
44
|
+
return await e().runKernel("Unpack16", { x: a }).array();
|
|
44
45
|
}
|
|
45
|
-
//#endregion
|
|
46
46
|
export { r as execute };
|
package/dist/checks/qkv.js
CHANGED
|
@@ -1,34 +1 @@
|
|
|
1
|
-
|
|
2
|
-
//#region lib/checks/qkv.ts
|
|
3
|
-
async function i(i) {
|
|
4
|
-
await r(i);
|
|
5
|
-
let a = e([[[.1, .2], [.3, .4]]], [
|
|
6
|
-
1,
|
|
7
|
-
2,
|
|
8
|
-
2
|
|
9
|
-
]), o = t([[
|
|
10
|
-
.5,
|
|
11
|
-
.6,
|
|
12
|
-
.9,
|
|
13
|
-
1,
|
|
14
|
-
1.3,
|
|
15
|
-
1.4
|
|
16
|
-
], [
|
|
17
|
-
.7,
|
|
18
|
-
.8,
|
|
19
|
-
1.1,
|
|
20
|
-
1.2,
|
|
21
|
-
1.5,
|
|
22
|
-
1.6
|
|
23
|
-
]], [2, 6]), s = n().runKernel("QKV", {
|
|
24
|
-
x: a,
|
|
25
|
-
kernel: o
|
|
26
|
-
}, { heads: 1 });
|
|
27
|
-
return [
|
|
28
|
-
await s[0].array(),
|
|
29
|
-
await s[1].array(),
|
|
30
|
-
await s[2].array()
|
|
31
|
-
];
|
|
32
|
-
}
|
|
33
|
-
//#endregion
|
|
34
|
-
export { i as execute };
|
|
1
|
+
export { t as execute } from "../qkv-BQfNPucX.js";
|
package/dist/checks/rope.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import { t as e } from "../RoPECache-dYscFINl.js";
|
|
2
|
+
import { H as t, J as n } from "../dist-CMMLi-qO.js";
|
|
3
|
+
import { t as r } from "../tensor4d-D1zRBipJ.js";
|
|
4
|
+
// lib/checks/rope.ts
|
|
4
5
|
async function i(i) {
|
|
5
6
|
await n(i);
|
|
6
|
-
let a =
|
|
7
|
+
let a = r([[[[.1, .2], [.3, .4]]]], [
|
|
7
8
|
1,
|
|
8
9
|
1,
|
|
9
10
|
2,
|
|
10
11
|
2
|
|
11
|
-
]), o = new
|
|
12
|
+
]), o = new e({
|
|
12
13
|
modelType: "GenAI_NanoGPT_v1",
|
|
13
14
|
vocabSize: 20,
|
|
14
15
|
nEmbed: 16,
|
|
@@ -26,5 +27,4 @@ async function i(i) {
|
|
|
26
27
|
});
|
|
27
28
|
return Array.isArray(s) ? s.map((e) => e.array()) : s.array();
|
|
28
29
|
}
|
|
29
|
-
//#endregion
|
|
30
30
|
export { i as execute };
|
package/dist/checks/weights.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// lib/checks/weights.ts
|
|
2
2
|
async function e(e) {
|
|
3
3
|
if (!Array.isArray(e) && e.dtype !== "float32") throw Error(`Unsupported dtype ${e.dtype} for weight statistics.`);
|
|
4
4
|
let t = Array.isArray(e) ? e : await e.data(), n = t.length, r = 0, i = 0, a = t[0], o = t[0], s = 0, c = !0, l = !1, u = 0;
|
|
@@ -23,5 +23,4 @@ async function t(t) {
|
|
|
23
23
|
for (let t of n) r[t.name] = await e(t);
|
|
24
24
|
return r;
|
|
25
25
|
}
|
|
26
|
-
//#endregion
|
|
27
26
|
export { e as createTensorStatistics, t as createWeightStatistics };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { E as e, Kt as t, Q as n, Z as r, rt as i, yi as a } from "./dist-CMMLi-qO.js";
|
|
2
|
+
// node_modules/@tensorflow/tfjs-core/dist/ops/clip_by_value.js
|
|
3
|
+
function o(r, o, s) {
|
|
4
|
+
let c = n(r, "x", "clipByValue");
|
|
5
|
+
if (a(o <= s, () => `Error in clip: min (${o}) must be less than or equal to max (${s}).`), o === s) return e(c.shape, o, c.dtype);
|
|
6
|
+
let l = { x: c }, u = {
|
|
7
|
+
clipValueMin: o,
|
|
8
|
+
clipValueMax: s
|
|
9
|
+
};
|
|
10
|
+
return i.runKernel(t, l, u);
|
|
11
|
+
}
|
|
12
|
+
var s = /* @__PURE__ */ r({ clipByValue_: o });
|
|
13
|
+
export { s as t };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Q as e, Si as t, Z as n, qt as r, rt as i } from "./dist-CMMLi-qO.js";
|
|
2
|
+
// node_modules/@tensorflow/tfjs-core/dist/ops/complex.js
|
|
3
|
+
function a(n, a) {
|
|
4
|
+
let o = e(n, "real", "complex"), s = e(a, "imag", "complex");
|
|
5
|
+
t(o.shape, s.shape, `real and imag shapes, ${o.shape} and ${s.shape}, must match in call to tf.complex().`);
|
|
6
|
+
let c = {
|
|
7
|
+
real: o,
|
|
8
|
+
imag: s
|
|
9
|
+
};
|
|
10
|
+
return i.runKernel(r, c);
|
|
11
|
+
}
|
|
12
|
+
var o = /* @__PURE__ */ n({ complex_: a });
|
|
13
|
+
export { o as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// node_modules/@tensorflow/tfjs-core/dist/backends/complex_util.js
|
|
2
2
|
function e(e, t) {
|
|
3
3
|
if (e.length !== t.length) throw Error(`Cannot merge real and imag arrays of different lengths. real:${e.length}, imag: ${t.length}.`);
|
|
4
4
|
let n = new Float32Array(e.length * 2);
|
|
@@ -56,5 +56,4 @@ function s(e, t, n) {
|
|
|
56
56
|
imag: Math.sin(r)
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
//#endregion
|
|
60
59
|
export { o as a, t as c, s as i, n, i as o, r, e as s, a as t };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { $ as e, M as t, Yt as n, Z as r, rt as i, yi as a } from "./dist-CMMLi-qO.js";
|
|
2
|
+
// node_modules/@tensorflow/tfjs-core/dist/ops/concat.js
|
|
3
|
+
function o(r, o = 0) {
|
|
4
|
+
a(r.length >= 1, () => "Pass at least one tensor to concat");
|
|
5
|
+
let s = e(r, "tensors", "concat", "string_or_numeric");
|
|
6
|
+
if (s[0].dtype === "complex64" && s.forEach((e) => {
|
|
7
|
+
if (e.dtype !== "complex64") throw Error(`Cannot concatenate complex64 tensors with a tensor
|
|
8
|
+
with dtype ${e.dtype}. `);
|
|
9
|
+
}), s.length === 1) return t(s[0]);
|
|
10
|
+
let c = s, l = { axis: o };
|
|
11
|
+
return i.runKernel(n, c, l);
|
|
12
|
+
}
|
|
13
|
+
var s = /* @__PURE__ */ r({ concat_: o });
|
|
14
|
+
export { s as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { yi as e } from "./dist-CMMLi-qO.js";
|
|
2
|
+
// node_modules/@tensorflow/tfjs-core/dist/ops/concat_util.js
|
|
3
3
|
function t(t, n) {
|
|
4
4
|
let r = t[0].length;
|
|
5
5
|
t.forEach((t, n) => {
|
|
@@ -15,5 +15,4 @@ function n(e, t) {
|
|
|
15
15
|
for (let r = 1; r < e.length; r++) n[t] += e[r][t];
|
|
16
16
|
return n;
|
|
17
17
|
}
|
|
18
|
-
//#endregion
|
|
19
18
|
export { n, t };
|
package/dist/data/docx.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as e } from "../
|
|
2
|
-
import { t } from "../jszip.min-
|
|
3
|
-
|
|
1
|
+
import { i as e } from "../rolldown-runtime-CwxnZyOB.js";
|
|
2
|
+
import { t } from "../jszip.min-Btv48m44.js";
|
|
3
|
+
// lib/data/docx.ts
|
|
4
4
|
var n = /* @__PURE__ */ e(t(), 1);
|
|
5
5
|
async function r(e) {
|
|
6
6
|
let t = await (await n.default.loadAsync(e)).file("word/document.xml")?.async("string");
|
|
@@ -14,5 +14,4 @@ function i(e) {
|
|
|
14
14
|
let t = new DOMParser().parseFromString(e, "application/xml");
|
|
15
15
|
return Array.from(t.getElementsByTagName("w:t")).map((e) => e.textContent).join("\n");
|
|
16
16
|
}
|
|
17
|
-
//#endregion
|
|
18
17
|
export { r as loadDOCX };
|
package/dist/data/pdf.js
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
let
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
let t = (await (await a.getPage(e)).getTextContent()).items.filter((e) => e.str.trim().length > 10).map((e) => e.str).join(" ");
|
|
9
|
-
if (s.push([{
|
|
1
|
+
async function e(e, t = 104857600) {
|
|
2
|
+
let n = await import("../pdf-CbnQ75VG.js");
|
|
3
|
+
n.GlobalWorkerOptions.workerSrc || (n.GlobalWorkerOptions.workerSrc = new URL("https://store.gen-ai.fi/llm/deps/pdf.worker.min.mjs").toString());
|
|
4
|
+
let r = await n.getDocument({ data: e instanceof Blob ? await e.arrayBuffer() : e }).promise, i = r.numPages, a = [], o = 0;
|
|
5
|
+
for (let e = 1; e <= i; e++) {
|
|
6
|
+
let n = (await (await r.getPage(e)).getTextContent()).items.filter((e) => e.str.trim().length > 10).map((e) => e.str).join(" ");
|
|
7
|
+
if (a.push([{
|
|
10
8
|
role: "text",
|
|
11
|
-
content:
|
|
12
|
-
}]),
|
|
9
|
+
content: n
|
|
10
|
+
}]), o += n.length, o > t) break;
|
|
13
11
|
}
|
|
14
|
-
return
|
|
12
|
+
return a;
|
|
15
13
|
}
|
|
16
|
-
|
|
17
|
-
export { n as loadPDF };
|
|
14
|
+
export { e as loadPDF };
|
package/dist/data/stream.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { n as JSONLConversationStream, e as MemoryConversationStream, t as ZipJSONLConversationStream };
|
|
1
|
+
export { t as JSONLConversationStream, n as MemoryConversationStream, r as ZipJSONLConversationStream } from "../stream-BBe2apn4.js";
|
package/dist/data/textLoader.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { i as e, t } from "../
|
|
1
|
+
import { i as e, t } from "../rolldown-runtime-CwxnZyOB.js";
|
|
2
2
|
import { loadPDF as n } from "./pdf.js";
|
|
3
3
|
import { loadDOCX as r } from "./docx.js";
|
|
4
|
-
import { n as i, r as a, t as o } from "../stream-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var s = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
4
|
+
import { n as i, r as a, t as o } from "../stream-BBe2apn4.js";
|
|
5
|
+
// lib/data/textLoader.ts
|
|
6
|
+
var s = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t, n) => {
|
|
8
7
|
((n, r) => {
|
|
9
8
|
typeof define == "function" && define.amd ? define([], r) : typeof t == "object" && e !== void 0 ? t.exports = r() : n.Papa = r();
|
|
10
|
-
})(
|
|
9
|
+
})(n, function e() {
|
|
11
10
|
var t = typeof self < "u" ? self : typeof window < "u" ? window : t === void 0 ? {} : t, n, r = !t.document && !!t.postMessage, i = t.IS_PAPA_WORKER || !1, a = {}, o = 0, s = {};
|
|
12
11
|
function c(e) {
|
|
13
12
|
this._handle = null, this._finished = !1, this._completed = !1, this._halted = !1, this._input = null, this._baseIndex = 0, this._partialLine = "", this._rowCount = 0, this._start = 0, this._nextChunk = null, this.isFirstChunk = !0, this._completeResults = {
|
|
@@ -141,10 +140,12 @@ var s = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
141
140
|
if (v && r && (w("Delimiter", "UndetectableDelimiter", "Unable to auto-detect delimiting character; defaulted to '" + s.DefaultDelimiter + "'"), r = !1), e.skipEmptyLines && (v.data = v.data.filter(function(e) {
|
|
142
141
|
return !b(e);
|
|
143
142
|
})), C()) {
|
|
144
|
-
if (v)
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
143
|
+
if (v) {
|
|
144
|
+
if (Array.isArray(v.data[0])) {
|
|
145
|
+
for (var t = 0; C() && t < v.data.length; t++) v.data[t].forEach(n);
|
|
146
|
+
v.data.splice(0, 1);
|
|
147
|
+
} else v.data.forEach(n);
|
|
148
|
+
}
|
|
148
149
|
function n(t, n) {
|
|
149
150
|
x(e.transformHeader) && (t = e.transformHeader(t, n)), _.push(t);
|
|
150
151
|
}
|
|
@@ -414,7 +415,7 @@ var s = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
414
415
|
if (typeof e == "string" && (e = JSON.parse(e)), Array.isArray(e)) {
|
|
415
416
|
if (!e.length || Array.isArray(e[0])) return p(null, e, l);
|
|
416
417
|
if (typeof e[0] == "object") return p(u || Object.keys(e[0]), e, l);
|
|
417
|
-
} else if (typeof e == "object") return typeof e.data == "string" && (e.data = JSON.parse(e.data)), Array.isArray(e.data) && (e.fields
|
|
418
|
+
} else if (typeof e == "object") return typeof e.data == "string" && (e.data = JSON.parse(e.data)), Array.isArray(e.data) && (e.fields || (e.fields = e.meta && e.meta.fields || u), e.fields || (e.fields = Array.isArray(e.data[0]) ? e.fields : typeof e.data[0] == "object" ? Object.keys(e.data[0]) : []), Array.isArray(e.data[0]) || typeof e.data[0] == "object" || (e.data = [e.data])), p(e.fields || [], e.data || [], l);
|
|
418
419
|
throw Error("Unable to serialize unrecognized input");
|
|
419
420
|
function p(e, t, n) {
|
|
420
421
|
var o = "", s = (typeof e == "string" && (e = JSON.parse(e)), typeof t == "string" && (t = JSON.parse(t)), Array.isArray(e) && 0 < e.length), c = !Array.isArray(t[0]);
|
|
@@ -552,8 +553,8 @@ async function f(e, t) {
|
|
|
552
553
|
complete: (n) => {
|
|
553
554
|
if (n.errors.length > 0) console.error(n.errors), r(/* @__PURE__ */ Error("bad_format"));
|
|
554
555
|
else {
|
|
555
|
-
let r = c(n.data[0], t?.column || "text");
|
|
556
|
-
e(new i(
|
|
556
|
+
let r = c(n.data[0], t?.column || "text"), a = t?.hasHeader ?? l(n.data[0]) ? n.data.slice(1) : n.data;
|
|
557
|
+
e(new i(a.map((e) => [{
|
|
557
558
|
role: "text",
|
|
558
559
|
content: e[r]
|
|
559
560
|
}])));
|
|
@@ -564,11 +565,11 @@ async function f(e, t) {
|
|
|
564
565
|
}
|
|
565
566
|
});
|
|
566
567
|
});
|
|
567
|
-
}
|
|
568
|
+
}
|
|
569
|
+
if (u === "text/plain") return new i([[{
|
|
568
570
|
role: "text",
|
|
569
571
|
content: await e.text()
|
|
570
572
|
}]]);
|
|
571
573
|
throw Error("unsupported_file_type");
|
|
572
574
|
}
|
|
573
|
-
//#endregion
|
|
574
575
|
export { f as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { n as e } from "./rolldown-runtime-CwxnZyOB.js";
|
|
2
|
+
import t from "./data/textLoader.js";
|
|
3
|
+
import { n } from "./stream-BBe2apn4.js";
|
|
4
|
+
import r from "./utilities/datasetID.js";
|
|
5
|
+
// lib/data.ts
|
|
6
|
+
var i = /* @__PURE__ */ e({
|
|
7
|
+
MemoryConversationStream: () => n,
|
|
8
|
+
generateDatasetID: () => r,
|
|
9
|
+
loadTextData: () => t
|
|
10
|
+
});
|
|
11
|
+
export { i as t };
|
package/dist/data.js
CHANGED
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import t from "./
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
var i = /* @__PURE__ */ e({
|
|
7
|
-
MemoryConversationStream: () => n,
|
|
8
|
-
generateDatasetID: () => t,
|
|
9
|
-
loadTextData: () => r
|
|
10
|
-
});
|
|
11
|
-
//#endregion
|
|
12
|
-
export { n as MemoryConversationStream, t as generateDatasetID, r as loadTextData, i as t };
|
|
1
|
+
import e from "./utilities/datasetID.js";
|
|
2
|
+
import { n as t } from "./stream-BBe2apn4.js";
|
|
3
|
+
import n from "./data/textLoader.js";
|
|
4
|
+
import "./data-CV_i_H6B.js";
|
|
5
|
+
export { t as MemoryConversationStream, e as generateDatasetID, n as loadTextData };
|