@genai-fi/nanogpt 1.4.1 → 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.
Files changed (341) hide show
  1. package/dist/{DatasetBuilder-DU1G1OKX.js → DatasetBuilder-DRDW8tcM.js} +85 -86
  2. package/dist/Generator-BcR_14Cj.js +316 -0
  3. package/dist/{RealDiv-CSnvtN2E.js → RealDiv-Cl8k3YTx.js} +54 -62
  4. package/dist/{Reshape-BlylqwWy.js → Reshape-CKxKPKqi.js} +9 -12
  5. package/dist/Reshape-H5zZRgr9.js +16 -0
  6. package/dist/RoPECache-dYscFINl.js +722 -0
  7. package/dist/TeachableLLM.js +29 -34
  8. package/dist/api/beamer.d.ts +1 -0
  9. package/dist/api/beamer.js +19 -10
  10. package/dist/api/responses.js +11 -12
  11. package/dist/api/training.js +12 -14
  12. package/dist/axis_util-rF9RnwKE.js +37 -0
  13. package/dist/backend.js +5 -6
  14. package/dist/{backend_util-DAV0I34P.js → backend_util-Cpp0Gwlp.js} +180 -185
  15. package/dist/{binary_op_util-CrYk9LXL.js → binary_op_util-WY9YIl0q.js} +3 -7
  16. package/dist/broadcast_to-CGvLNiQ0.js +20 -0
  17. package/dist/checks/appendCache.js +7 -7
  18. package/dist/checks/attentionMask.js +9 -8
  19. package/dist/checks/check.js +1 -2
  20. package/dist/checks/gelu.js +6 -6
  21. package/dist/checks/index.js +24 -25
  22. package/dist/checks/matMulGelu.js +7 -7
  23. package/dist/checks/normRMS.js +14 -12
  24. package/dist/checks/normRMSGrad.js +9 -8
  25. package/dist/checks/packUnpack.js +7 -7
  26. package/dist/checks/qkv.js +1 -34
  27. package/dist/checks/rope.js +6 -6
  28. package/dist/checks/weights.js +1 -2
  29. package/dist/clip_by_value-D-UX9am5.js +13 -0
  30. package/dist/complex-Cl904TqN.js +13 -0
  31. package/dist/{complex_util-CkazZsaH.js → complex_util-BBlPAm-s.js} +1 -2
  32. package/dist/concat-Oip5acVY.js +14 -0
  33. package/dist/{concat_util-CWzvQQlK.js → concat_util-CY45Hf4F.js} +2 -3
  34. package/dist/data/docx.js +3 -4
  35. package/dist/data/pdf.js +11 -14
  36. package/dist/data/stream.js +1 -2
  37. package/dist/data/textLoader.js +16 -15
  38. package/dist/data-CV_i_H6B.js +11 -0
  39. package/dist/data.js +5 -12
  40. package/dist/dist-CMMLi-qO.js +2675 -0
  41. package/dist/{dist-BGVm64AY.js → dist-DeVH1nGn.js} +1465 -1573
  42. package/dist/{dist-CwK5S7Ls.js → dist-DyL7qSLJ.js} +2664 -2400
  43. package/dist/dropout16-CA31Ud5a.js +20 -0
  44. package/dist/dropout_util-SiFMbFXz.js +22 -0
  45. package/dist/{eventemitter3-D_qV3Lof.js → eventemitter3-wmfmOP_f.js} +2 -3
  46. package/dist/expand_dims-Dh3Fulyn.js +10 -0
  47. package/dist/floor-BwjmUb7X.js +8 -0
  48. package/dist/gather-B5Z1RFt5.js +14 -0
  49. package/dist/gatherSub-CRUfUzBa.js +22 -0
  50. package/dist/gelu-Xx9-ohH9.js +25 -0
  51. package/dist/{gpgpu_math-20tPK8LM.js → gpgpu_math-48m8q3jI.js} +265 -286
  52. package/dist/inference/Beamer.d.ts +14 -2
  53. package/dist/inference/Beamer.js +170 -105
  54. package/dist/inference/Generator.js +1 -259
  55. package/dist/inference/tokenisePrompt.d.ts +2 -1
  56. package/dist/inference/tokenisePrompt.js +15 -11
  57. package/dist/inference/types.d.ts +7 -0
  58. package/dist/inference/utilities.js +1 -2
  59. package/dist/{jszip.min-DKa1Rjyn.js → jszip.min-Btv48m44.js} +68 -64
  60. package/dist/{kernel_funcs_utils-ql8Y8qPn.js → kernel_funcs_utils-BYRpSfV_.js} +39 -42
  61. package/dist/layers/BaseLayer.js +9 -10
  62. package/dist/layers/{CausalSelfAttention.d.ts → GQA.d.ts} +8 -3
  63. package/dist/layers/GQA.js +102 -0
  64. package/dist/layers/HeadLayer.d.ts +12 -0
  65. package/dist/layers/HeadLayer.js +28 -0
  66. package/dist/layers/LoRA.js +17 -20
  67. package/dist/layers/MHA.d.ts +43 -0
  68. package/dist/layers/MHA.js +102 -0
  69. package/dist/layers/MLP.d.ts +5 -1
  70. package/dist/layers/MLP.js +33 -20
  71. package/dist/layers/PositionEmbedding.js +14 -13
  72. package/dist/layers/RMSNorm.d.ts +2 -0
  73. package/dist/layers/RMSNorm.js +16 -11
  74. package/dist/layers/RoPECache.js +1 -337
  75. package/dist/layers/TiedEmbedding.js +15 -14
  76. package/dist/layers/TransformerBlock.d.ts +4 -10
  77. package/dist/layers/TransformerBlock.js +29 -30
  78. package/dist/layers/WeightStore.js +4 -5
  79. package/dist/layers-CFqEip3s.js +13 -0
  80. package/dist/layers.d.ts +1 -1
  81. package/dist/layers.js +4 -12
  82. package/dist/loader/load.js +27 -24
  83. package/dist/loader/loadHF.js +3 -3
  84. package/dist/loader/loadTransformers.js +22 -7
  85. package/dist/loader/loadZipMeta.js +1 -2
  86. package/dist/loader/newZipLoad.js +1 -2
  87. package/dist/loader/oldZipLoad.js +8 -9
  88. package/dist/loader/save.js +31 -17
  89. package/dist/loader/types.d.ts +8 -2
  90. package/dist/main.js +3281 -3463
  91. package/dist/matMul16-tE26fnhf.js +87 -0
  92. package/dist/{matMulGelu-CBoqTZM7.js → matMulGelu-ASUWlKqu.js} +33 -33
  93. package/dist/mat_mul-R9_DWmIT.js +16 -0
  94. package/dist/models/Llama.d.ts +16 -0
  95. package/dist/models/Llama.js +88 -0
  96. package/dist/models/NanoGPTV1.js +53 -54
  97. package/dist/models/NanoGPTV2.js +48 -49
  98. package/dist/models/Qwen3.d.ts +16 -0
  99. package/dist/models/Qwen3.js +88 -0
  100. package/dist/models/config.d.ts +18 -1
  101. package/dist/models/config.js +3 -8
  102. package/dist/models/factory.js +14 -11
  103. package/dist/models/model.d.ts +5 -7
  104. package/dist/models/model.js +1 -2
  105. package/dist/models-DyBpJJwM.js +13 -0
  106. package/dist/models.js +6 -14
  107. package/dist/mul16-C7sqgqik.js +41 -0
  108. package/dist/non_max_suppression_impl-B0H318rb.js +72 -0
  109. package/dist/not_equal-Bu3O8rh_.js +67 -0
  110. package/dist/one_hot-TEMPumJj.js +14 -0
  111. package/dist/ones-DpPXWa6A.js +13 -0
  112. package/dist/ops/adamAdjust.js +2 -3
  113. package/dist/ops/adamMoments.js +2 -3
  114. package/dist/ops/add16.js +2 -3
  115. package/dist/ops/appendCache.js +9 -8
  116. package/dist/ops/attentionMask.d.ts +1 -1
  117. package/dist/ops/attentionMask.js +8 -5
  118. package/dist/ops/concat16.js +5 -5
  119. package/dist/ops/cpu/adamAdjust.js +7 -8
  120. package/dist/ops/cpu/adamMoments.js +5 -5
  121. package/dist/ops/cpu/appendCache.js +3 -3
  122. package/dist/ops/cpu/attentionMask.js +12 -8
  123. package/dist/ops/cpu/fusedSoftmax.js +3 -3
  124. package/dist/ops/cpu/gatherSub.js +1 -12
  125. package/dist/ops/cpu/gelu.js +12 -13
  126. package/dist/ops/cpu/matMul16.js +7 -7
  127. package/dist/ops/cpu/matMulGelu.js +21 -18
  128. package/dist/ops/cpu/matMulMul.js +8 -9
  129. package/dist/ops/cpu/mulDropout.js +8 -9
  130. package/dist/ops/cpu/normRMS.js +12 -13
  131. package/dist/ops/cpu/qkv.js +14 -13
  132. package/dist/ops/cpu/rope.js +11 -8
  133. package/dist/ops/cpu/scatterSub.js +1 -12
  134. package/dist/ops/dot16.js +16 -17
  135. package/dist/ops/dropout.js +9 -8
  136. package/dist/ops/dropout16.js +1 -22
  137. package/dist/ops/gatherSub.js +3 -4
  138. package/dist/ops/gelu.js +1 -2
  139. package/dist/ops/globalNorm.js +14 -14
  140. package/dist/ops/grads/add16.js +16 -17
  141. package/dist/ops/grads/attentionMask.js +6 -7
  142. package/dist/ops/grads/dropout16.js +1 -1
  143. package/dist/ops/grads/gelu.js +1 -2
  144. package/dist/ops/grads/matMul16.js +1 -2
  145. package/dist/ops/grads/matMulGelu.js +6 -7
  146. package/dist/ops/grads/mul16.js +1 -1
  147. package/dist/ops/grads/normRMS.js +8 -9
  148. package/dist/ops/grads/pack16.js +1 -2
  149. package/dist/ops/grads/qkv.js +10 -10
  150. package/dist/ops/grads/rope.js +1 -2
  151. package/dist/ops/grads/silu.d.ts +2 -0
  152. package/dist/ops/grads/silu.js +1 -0
  153. package/dist/ops/grads/softmax16.js +6 -7
  154. package/dist/ops/grads/unpack16.js +1 -2
  155. package/dist/ops/grads/utils.js +1 -2
  156. package/dist/ops/matMul16.d.ts +2 -2
  157. package/dist/ops/matMul16.js +1 -2
  158. package/dist/ops/matMulGelu.js +3 -4
  159. package/dist/ops/matMulMul.js +2 -3
  160. package/dist/ops/mul16.js +1 -43
  161. package/dist/ops/mulDrop.js +2 -3
  162. package/dist/ops/normRMS.d.ts +1 -1
  163. package/dist/ops/normRMS.js +10 -11
  164. package/dist/ops/pack16.js +1 -2
  165. package/dist/ops/qkv.js +2 -3
  166. package/dist/ops/reshape16.js +11 -11
  167. package/dist/ops/rope.d.ts +1 -1
  168. package/dist/ops/rope.js +1 -2
  169. package/dist/ops/scatterSub.js +3 -4
  170. package/dist/ops/silu.d.ts +3 -0
  171. package/dist/ops/silu.js +1 -0
  172. package/dist/ops/slice16.js +5 -5
  173. package/dist/ops/softmax16.js +3 -4
  174. package/dist/ops/sub16.js +3 -4
  175. package/dist/ops/sum16.js +3 -3
  176. package/dist/ops/transpose16.js +16 -15
  177. package/dist/ops/unpack16.js +1 -2
  178. package/dist/ops/webgl/adamAdjust.js +8 -9
  179. package/dist/ops/webgl/adamMoments.js +2 -3
  180. package/dist/ops/webgl/appendCache.js +2 -3
  181. package/dist/ops/webgl/attentionMask.js +2 -3
  182. package/dist/ops/webgl/dropout16.js +2 -3
  183. package/dist/ops/webgl/fusedSoftmax.js +13 -13
  184. package/dist/ops/webgl/gatherSub.js +2 -3
  185. package/dist/ops/webgl/gelu.js +11 -12
  186. package/dist/ops/webgl/log.js +10 -10
  187. package/dist/ops/webgl/matMul16.js +31 -24
  188. package/dist/ops/webgl/matMulGelu.js +1 -2
  189. package/dist/ops/webgl/matMulMul.js +3 -4
  190. package/dist/ops/webgl/mulDropout.js +2 -3
  191. package/dist/ops/webgl/normRMS.js +11 -10
  192. package/dist/ops/webgl/qkv.js +2 -3
  193. package/dist/ops/webgl/rope.js +10 -9
  194. package/dist/ops/webgl/scatterSub.js +2 -3
  195. package/dist/ops/webgpu/adamAdjust.js +13 -14
  196. package/dist/ops/webgpu/adamMoments.js +13 -14
  197. package/dist/ops/webgpu/add16.js +3 -4
  198. package/dist/ops/webgpu/appendCache.js +20 -21
  199. package/dist/ops/webgpu/attentionMask.js +18 -19
  200. package/dist/ops/webgpu/attentionMask32_program.js +7 -8
  201. package/dist/ops/webgpu/clipScale.js +11 -12
  202. package/dist/ops/webgpu/concat16.js +17 -18
  203. package/dist/ops/webgpu/dropout16.js +6 -7
  204. package/dist/ops/webgpu/gatherSub.js +11 -12
  205. package/dist/ops/webgpu/gelu.js +10 -11
  206. package/dist/ops/webgpu/index.js +17 -16
  207. package/dist/ops/webgpu/matMul16.js +74 -57
  208. package/dist/ops/webgpu/matMul16_program.d.ts +4 -3
  209. package/dist/ops/webgpu/matMul16_program.js +30 -22
  210. package/dist/ops/webgpu/mul16.js +3 -4
  211. package/dist/ops/webgpu/norm2.js +9 -10
  212. package/dist/ops/webgpu/normRMS.js +13 -14
  213. package/dist/ops/webgpu/normRMS16_program.d.ts +2 -1
  214. package/dist/ops/webgpu/normRMS16_program.js +5 -5
  215. package/dist/ops/webgpu/normRMS32_program.d.ts +2 -1
  216. package/dist/ops/webgpu/normRMS32_program.js +5 -5
  217. package/dist/ops/webgpu/normRMSGrad.js +30 -30
  218. package/dist/ops/webgpu/pack16.js +2 -3
  219. package/dist/ops/webgpu/pack16_program.js +3 -4
  220. package/dist/ops/webgpu/qkv.js +10 -11
  221. package/dist/ops/webgpu/rope.js +113 -49
  222. package/dist/ops/webgpu/scatterSub.js +12 -13
  223. package/dist/ops/webgpu/silu.d.ts +14 -0
  224. package/dist/ops/webgpu/silu.js +117 -0
  225. package/dist/ops/webgpu/slice16.js +17 -18
  226. package/dist/ops/webgpu/softmax16.js +9 -9
  227. package/dist/ops/webgpu/softmax16_program.js +9 -10
  228. package/dist/ops/webgpu/softmax16_subgroup_program.js +11 -12
  229. package/dist/ops/webgpu/softmax16grad.js +8 -9
  230. package/dist/ops/webgpu/sub16.js +3 -4
  231. package/dist/ops/webgpu/sum16.js +16 -15
  232. package/dist/ops/webgpu/transpose16.js +13 -12
  233. package/dist/ops/webgpu/transpose16_program.js +3 -4
  234. package/dist/ops/webgpu/transpose16_shared_program.js +17 -18
  235. package/dist/ops/webgpu/unpack16.js +8 -9
  236. package/dist/ops/webgpu/utils/binary_op.js +20 -21
  237. package/dist/ops/webgpu/utils/deviceInfo.js +1 -2
  238. package/dist/ops/webgpu/utils/reductions.js +21 -20
  239. package/dist/ops-Be5ACU5R.js +13 -0
  240. package/dist/ops-C1UpdEYM.js +509 -0
  241. package/dist/{pack16-BhuXNUS7.js → pack16-BHO4t1-M.js} +14 -17
  242. package/dist/pad-Dy-1IP3A.js +13 -0
  243. package/dist/patches/webgpu_backend.js +18 -19
  244. package/dist/patches/webgpu_base.js +2 -3
  245. package/dist/patches/webgpu_program.js +21 -22
  246. package/dist/{pdf-Bzuk68Vy.js → pdf-CbnQ75VG.js} +380 -701
  247. package/dist/{picomatch-BO4HbNfo.js → picomatch--TW6gyBJ.js} +229 -291
  248. package/dist/qkv-BQfNPucX.js +42 -0
  249. package/dist/rand_util-_vCY93Uw.js +44 -0
  250. package/dist/random_normal-DUIT8kyC.js +11 -0
  251. package/dist/range-CYvQC3fW.js +13 -0
  252. package/dist/relu-C4XULT8A.js +8 -0
  253. package/dist/reshape-DJb1jgMt.js +8 -0
  254. package/dist/resize_nearest_neighbor-DAqcTYUe.js +188 -0
  255. package/dist/{chunk-CWhphoD1.js → rolldown-runtime-CwxnZyOB.js} +4 -5
  256. package/dist/rope-JjBVufF_.js +24 -0
  257. package/dist/scatterSub-BOnqk-uY.js +27 -0
  258. package/dist/scatter_nd_util-BepMCpLY.js +34 -0
  259. package/dist/seedrandom-SHEGFK6H.js +282 -0
  260. package/dist/selu_util-DeOTf-sc.js +27 -0
  261. package/dist/shared-BIDMUBCs.js +1864 -0
  262. package/dist/{shared-CfTzpULd.js → shared-CX_iPI5K.js} +2 -3
  263. package/dist/silu-DsAE2cJ5.js +23 -0
  264. package/dist/slice-Dlb1FlzG.js +13 -0
  265. package/dist/{slice_util-Dve4TkDn.js → slice_util-BVgPRoij.js} +3 -4
  266. package/dist/softmax-Dpav_dWw.js +10 -0
  267. package/dist/split-DYnT8chz.js +11 -0
  268. package/dist/squeeze-B3XYGAlg.js +9 -0
  269. package/dist/stack-Dbbt9mIk.js +10 -0
  270. package/dist/step-DA-5DNu9.js +348 -0
  271. package/dist/{stream-BpAwcvHz.js → stream-BBe2apn4.js} +68 -88
  272. package/dist/sum-C8qNbFNp.js +13 -0
  273. package/dist/tensor-ALxWZfmz.js +7 -0
  274. package/dist/tensor1d-BHgkkhTE.js +9 -0
  275. package/dist/tensor2d-ARItvqVn.js +10 -0
  276. package/dist/tensor4d-D1zRBipJ.js +10 -0
  277. package/dist/tfjs_backend-CsXOum0h.js +685 -0
  278. package/dist/tile-DfyQ0KX-.js +10 -0
  279. package/dist/tokenise-DbS2Ea-T.js +14 -0
  280. package/dist/tokenise.js +6 -15
  281. package/dist/tokeniser/BaseTokeniser.js +5 -9
  282. package/dist/tokeniser/CharTokeniser.js +1 -2
  283. package/dist/tokeniser/bpe.js +19 -20
  284. package/dist/topk-BrU2pkrR.js +19 -0
  285. package/dist/training/AdamW.js +35 -31
  286. package/dist/training/BasicTrainer.js +56 -56
  287. package/dist/training/DatasetBuilder.js +1 -2
  288. package/dist/training/Evaluator.js +8 -5
  289. package/dist/training/LRScheduler.js +1 -2
  290. package/dist/training/PreTrainer.js +7 -8
  291. package/dist/training/SFTTrainer.js +7 -8
  292. package/dist/training/configure.js +16 -15
  293. package/dist/training/factory.js +1 -2
  294. package/dist/training/loss.js +1 -2
  295. package/dist/training/orthoGrad.js +2 -3
  296. package/dist/training/prepareData.js +18 -17
  297. package/dist/training/sparseCrossEntropy.js +38 -32
  298. package/dist/training/tasks/TokenStore.js +21 -22
  299. package/dist/training/tasks/tokenStream.js +1 -2
  300. package/dist/training/validateOptions.js +1 -2
  301. package/dist/training/validation.js +1 -2
  302. package/dist/transpose-BC-M_OoT.js +34 -0
  303. package/dist/unsorted_segment_sum-BelC7R-q.js +408 -0
  304. package/dist/utilities/arrayClose.js +5 -4
  305. package/dist/utilities/arrayShape.js +1 -2
  306. package/dist/utilities/datasetID.js +1 -2
  307. package/dist/utilities/dummy.js +15 -15
  308. package/dist/utilities/float16.js +10 -10
  309. package/dist/utilities/maxHeap.d.ts +16 -0
  310. package/dist/utilities/maxHeap.js +54 -0
  311. package/dist/utilities/multinomialCPU.d.ts +1 -2
  312. package/dist/utilities/multinomialCPU.js +6 -8
  313. package/dist/utilities/packed.js +2 -3
  314. package/dist/utilities/parameters.js +34 -19
  315. package/dist/utilities/performance.js +2 -3
  316. package/dist/utilities/profile.js +3 -4
  317. package/dist/utilities/random.js +1 -2
  318. package/dist/utilities/safetensors.js +14 -14
  319. package/dist/utilities/sentences.js +16 -13
  320. package/dist/utilities/tokenParse.js +1 -2
  321. package/dist/utilities/tokens.js +5 -6
  322. package/dist/utilities/topP.d.ts +1 -0
  323. package/dist/utilities/topP.js +20 -13
  324. package/dist/utilities/waitForModel.js +1 -2
  325. package/dist/utilities/weights.js +4 -4
  326. package/dist/utilities/yielder.js +1 -2
  327. package/dist/{v4-BK7K-jy_.js → v4-YCkfo8OR.js} +4 -7
  328. package/dist/{webgpu-IAn9VotJ.js → webgpu-BHX-uBym.js} +156 -163
  329. package/dist/{webgpu_program-B0PokuRJ.js → webgpu_program-DvkFqRlR.js} +28 -29
  330. package/dist/{webgpu_util-DfODg6XI.js → webgpu_util-5QTyovaf.js} +2 -3
  331. package/dist/zeros-hxKGkRfl.js +12 -0
  332. package/package.json +3 -3
  333. package/dist/Reshape-CwxdaU8n.js +0 -17
  334. package/dist/dist-Da20xy8E.js +0 -6375
  335. package/dist/gelu-B6637MKa.js +0 -27
  336. package/dist/layers/CausalSelfAttention.js +0 -99
  337. package/dist/matMul16-DGtlziMn.js +0 -81
  338. package/dist/rope-C8EAiSGY.js +0 -25
  339. package/dist/selu_util-B_AFEfoz.js +0 -24
  340. package/dist/shared-24EoeHJl.js +0 -1314
  341. package/dist/tfjs_backend-h5weiy1O.js +0 -614
@@ -0,0 +1,685 @@
1
+ import { C as e, D as t, N as n, O as r, Q as i, Y as a, Z as o, gi as s, j as c, k as l, m as u, qi as d, rt as f, st as ee, ut as p, vt as m, yi as h, z as g } from "./dist-CMMLi-qO.js";
2
+ import { a as _ } from "./step-DA-5DNu9.js";
3
+ import { t as v } from "./reshape-DJb1jgMt.js";
4
+ import { t as y } from "./concat-Oip5acVY.js";
5
+ import { t as b } from "./mat_mul-R9_DWmIT.js";
6
+ import { t as x } from "./slice-Dlb1FlzG.js";
7
+ import { t as S } from "./clip_by_value-D-UX9am5.js";
8
+ import { t as C } from "./tile-DfyQ0KX-.js";
9
+ import { t as te } from "./floor-BwjmUb7X.js";
10
+ import { t as w } from "./gather-B5Z1RFt5.js";
11
+ import { t as T } from "./transpose-BC-M_OoT.js";
12
+ import { t as E } from "./random_normal-DUIT8kyC.js";
13
+ import { n as D, t as O } from "./dropout_util-SiFMbFXz.js";
14
+ import { t as k } from "./tensor1d-BHgkkhTE.js";
15
+ import { a as ne, i as re, o as ie, r as ae } from "./selu_util-DeOTf-sc.js";
16
+ // node_modules/@tensorflow/tfjs-core/dist/ops/concat_1d.js
17
+ function A(e) {
18
+ return y(e, 0);
19
+ }
20
+ var j = /* @__PURE__ */ o({ concat1d_: A });
21
+ // node_modules/@tensorflow/tfjs-core/dist/ops/concat_2d.js
22
+ function M(e, t) {
23
+ return y(e, t);
24
+ }
25
+ var N = /* @__PURE__ */ o({ concat2d_: M });
26
+ // node_modules/@tensorflow/tfjs-core/dist/ops/concat_3d.js
27
+ function P(e, t) {
28
+ return y(e, t);
29
+ }
30
+ var oe = /* @__PURE__ */ o({ concat3d_: P });
31
+ // node_modules/@tensorflow/tfjs-core/dist/ops/concat_4d.js
32
+ function se(e, t) {
33
+ return y(e, t);
34
+ }
35
+ var ce = /* @__PURE__ */ o({ concat4d_: se });
36
+ // node_modules/@tensorflow/tfjs-core/dist/ops/slice1d.js
37
+ function le(e, t, n) {
38
+ let r = i(e, "x", "slice1d");
39
+ return h(r.rank === 1, () => `slice1d expects a rank-1 tensor, but got a rank-${r.rank} tensor`), x(r, [t], [n]);
40
+ }
41
+ var F = /* @__PURE__ */ o({ slice1d_: le });
42
+ // node_modules/@tensorflow/tfjs-core/dist/ops/slice2d.js
43
+ function ue(e, t, n) {
44
+ let r = i(e, "x", "slice2d");
45
+ return h(r.rank === 2, () => `slice2d expects a rank-2 tensor, but got a rank-${r.rank} tensor`), x(r, t, n);
46
+ }
47
+ var de = /* @__PURE__ */ o({ slice2d_: ue });
48
+ // node_modules/@tensorflow/tfjs-core/dist/ops/slice3d.js
49
+ function fe(e, t, n) {
50
+ let r = i(e, "x", "slice3d");
51
+ return h(r.rank === 3, () => `slice3d expects a rank-3 tensor, but got a rank-${r.rank} tensor`), x(r, t, n);
52
+ }
53
+ var I = /* @__PURE__ */ o({ slice3d_: fe });
54
+ // node_modules/@tensorflow/tfjs-core/dist/ops/slice4d.js
55
+ function pe(e, t, n) {
56
+ let r = i(e, "x", "slice4d");
57
+ return h(r.rank === 4, () => `slice4d expects a rank-4 tensor, but got a rank-${r.rank} tensor`), x(r, t, n);
58
+ }
59
+ var L = /* @__PURE__ */ o({ slice4d_: pe });
60
+ // node_modules/@tensorflow/tfjs-core/dist/ops/dropout.js
61
+ function me(e, t, n, a) {
62
+ let o = i(e, "x", "dropout");
63
+ if (h(o.dtype === "float32", () => `x has to be a floating point tensor since it's going to be scaled, but got a ${o.dtype} tensor instead.`), h(t >= 0 && t < 1, () => `rate must be a float in the range [0, 1), but got ${t}.`), t === 0) return e instanceof p ? o.clone() : o;
64
+ let s = O(o, n), u = 1 - t, d = l(te(c(D(s, 0, 1, "float32", a), u)), u);
65
+ return r(o, d);
66
+ }
67
+ var he = /* @__PURE__ */ o({ dropout_: me });
68
+ // node_modules/@tensorflow/tfjs-core/dist/ops/fused/mat_mul.js
69
+ function ge({ a: t, b: n, transposeA: r = !1, transposeB: a = !1, bias: o, activation: l = "linear", preluActivationWeights: p, leakyreluAlpha: m = .2 }) {
70
+ if (ie(f.state.gradientDepth, l) === !1) {
71
+ let e = b(t, n, r, a);
72
+ return o != null && (e = c(e, o)), ae(e, l, p, m);
73
+ }
74
+ let g = i(t, "a", "fused matMul"), _ = i(n, "b", "fused matMul");
75
+ [g, _] = ee(g, _);
76
+ let y = r ? g.shape[g.rank - 2] : g.shape[g.rank - 1], x = a ? _.shape[_.rank - 1] : _.shape[_.rank - 2], S = r ? g.shape[g.rank - 1] : g.shape[g.rank - 2], C = a ? _.shape[_.rank - 2] : _.shape[_.rank - 1], te = g.shape.slice(0, -2), w = _.shape.slice(0, -2), T = d(te), E = d(w);
77
+ h(y === x, () => `Error in fused matMul: inner shapes (${y}) and (${x}) of Tensors with shapes ${g.shape} and ${_.shape} and transposeA=${r} and transposeB=${a} must match.`);
78
+ let D = e(g.shape.slice(0, -2), _.shape.slice(0, -2)).concat([S, C]), O = r ? v(g, [
79
+ T,
80
+ y,
81
+ S
82
+ ]) : v(g, [
83
+ T,
84
+ S,
85
+ y
86
+ ]), k = a ? v(_, [
87
+ E,
88
+ C,
89
+ x
90
+ ]) : v(_, [
91
+ E,
92
+ x,
93
+ C
94
+ ]), A;
95
+ o != null && (A = i(o, "bias", "fused matMul"), [A] = ee(A, g), e(D, A.shape));
96
+ let j;
97
+ p != null && (j = i(p, "prelu weights", "fused matMul"));
98
+ let M = (e, t) => {
99
+ let [n, i, s, c] = t, u = ne(v(e, s.shape), s, l), d, f;
100
+ if (!r && !a ? (d = b(u, i, !1, !0), f = b(n, u, !0, !1)) : !r && a ? (d = b(u, i, !1, !1), f = b(u, n, !0, !1)) : r && !a ? (d = b(i, u, !1, !0), f = b(n, u, !1, !1)) : (d = b(i, u, !0, !0), f = b(u, n, !0, !0)), o != null) {
101
+ let e = re(c, u);
102
+ return [
103
+ d,
104
+ f,
105
+ e
106
+ ];
107
+ }
108
+ return [d, f];
109
+ }, N = {
110
+ a: O,
111
+ b: k,
112
+ bias: A,
113
+ preluActivationWeights: j
114
+ }, P = {
115
+ transposeA: r,
116
+ transposeB: a,
117
+ activation: l,
118
+ leakyreluAlpha: m
119
+ };
120
+ return o == null ? u((e, t, n) => {
121
+ let r = f.runKernel(s, N, P);
122
+ return n([
123
+ e,
124
+ t,
125
+ r
126
+ ]), {
127
+ value: v(r, D),
128
+ gradFunc: M
129
+ };
130
+ })(O, k) : u((e, t, n, r) => {
131
+ let i = f.runKernel(s, N, P);
132
+ return r([
133
+ e,
134
+ t,
135
+ i,
136
+ n
137
+ ]), {
138
+ value: v(i, D),
139
+ gradFunc: M
140
+ };
141
+ })(O, k, A);
142
+ }
143
+ var R = /* @__PURE__ */ o({ fusedMatMul_: ge }), _e = ["channelsFirst", "channelsLast"], ve = ["nearest", "bilinear"], ye = [
144
+ "valid",
145
+ "same",
146
+ "causal"
147
+ ], be = ["max", "avg"], xe = [
148
+ "sum",
149
+ "mul",
150
+ "concat",
151
+ "ave"
152
+ ], Se = class e extends Error {
153
+ constructor(t) {
154
+ super(t), Object.setPrototypeOf(this, e.prototype);
155
+ }
156
+ }, Ce = class e extends Error {
157
+ constructor(t) {
158
+ super(t), Object.setPrototypeOf(this, e.prototype);
159
+ }
160
+ }, z = class e extends Error {
161
+ constructor(t) {
162
+ super(t), Object.setPrototypeOf(this, e.prototype);
163
+ }
164
+ }, B = class e extends Error {
165
+ constructor(t) {
166
+ super(t), Object.setPrototypeOf(this, e.prototype);
167
+ }
168
+ }, we = class e extends Error {
169
+ constructor(t) {
170
+ super(t), Object.setPrototypeOf(this, e.prototype);
171
+ }
172
+ };
173
+ // node_modules/@tensorflow/tfjs-layers/dist/utils/generic_utils.js
174
+ function Te(e, t) {
175
+ if (Array.isArray(e)) {
176
+ let n = [];
177
+ for (let r = 0; r < t; r++) n = n.concat(e);
178
+ return n;
179
+ }
180
+ {
181
+ let n = Array(t);
182
+ return n.fill(e), n;
183
+ }
184
+ }
185
+ function V(e, t) {
186
+ if (!e) throw new we(t);
187
+ }
188
+ function Ee(e, t) {
189
+ let n = 0;
190
+ for (let r of e) r === t && n++;
191
+ return n;
192
+ }
193
+ function De(e) {
194
+ return e.length === 1 ? e[0] : e;
195
+ }
196
+ function Oe(e) {
197
+ return Array.isArray(e) ? e : [e];
198
+ }
199
+ function ke(e) {
200
+ let t = e.replace(/(.)([A-Z][a-z0-9]+)/g, "$1_$2").replace(/([a-z])([A-Z])/g, "$1_$2").toLowerCase();
201
+ return t[0] === "_" ? "private" + t : t;
202
+ }
203
+ function Ae(e) {
204
+ return e.length <= 1 || e.indexOf("_") === -1 ? e : e.replace(/[_]+(\w|$)/g, (e, t) => t.toUpperCase());
205
+ }
206
+ var H = {};
207
+ function je(e) {
208
+ if (e == null) return null;
209
+ let t = {};
210
+ return t.className = e.getClassName(), t.config = e.getConfig(), t;
211
+ }
212
+ function U(e) {
213
+ if (typeof e == "object" && e) {
214
+ if (Array.isArray(e)) e.forEach((e) => U(e));
215
+ else {
216
+ let t = Object.keys(e);
217
+ for (let n of t) {
218
+ let t = e[n];
219
+ typeof t == "object" && t && (!Array.isArray(t) && t.type === "ndarray" && typeof t.value == "number" ? e[n] = t.value : U(t));
220
+ }
221
+ }
222
+ }
223
+ }
224
+ function Me(e, t = {}, n = {}, r = "object", i = !1) {
225
+ if (typeof e == "string") {
226
+ let i = e, a;
227
+ if (i in n) a = n[i];
228
+ else if (i in H) a = H[i];
229
+ else if (a = t[i], a == null) throw new z(`Unknown ${r}: ${e}. This may be due to one of the following reasons:\n1. The ${r} is defined in Python, in which case it needs to be ported to TensorFlow.js or your JavaScript code.\n2. The custom ${r} is defined in JavaScript, but is not registered properly with tf.serialization.registerClass().`);
230
+ return a;
231
+ }
232
+ {
233
+ let a = e;
234
+ if (a.className == null || a.config == null) throw new z(`${r}: Improper config format: ${JSON.stringify(a)}.\n'className' and 'config' must set.`);
235
+ let o = a.className, s, c;
236
+ if (o in n ? [s, c] = n[o] : o in H ? [s, c] = H.className : o in t && ([s, c] = t[o]), s == null) throw new z(`Unknown ${r}: ${o}. This may be due to one of the following reasons:\n1. The ${r} is defined in Python, in which case it needs to be ported to TensorFlow.js or your JavaScript code.\n2. The custom ${r} is defined in JavaScript, but is not registered properly with tf.serialization.registerClass().`);
237
+ if (c != null) {
238
+ let e = {};
239
+ for (let t of Object.keys(H)) e[t] = H[t];
240
+ for (let t of Object.keys(n)) e[t] = n[t];
241
+ let t = a.config;
242
+ t.customObjects = e;
243
+ let r = Object.assign({}, H);
244
+ for (let e of Object.keys(n)) H[e] = n[e];
245
+ U(a.config);
246
+ let o = c(s, a.config, n, i);
247
+ return H = Object.assign({}, r), o;
248
+ }
249
+ {
250
+ let e = Object.assign({}, H);
251
+ for (let e of Object.keys(n)) H[e] = n[e];
252
+ let t = new s(a.config);
253
+ return H = Object.assign({}, e), t;
254
+ }
255
+ }
256
+ }
257
+ function Ne(e, t) {
258
+ return e < t ? -1 : +(e > t);
259
+ }
260
+ function Pe(e, t) {
261
+ return -1 * Ne(e, t);
262
+ }
263
+ function Fe(e) {
264
+ if (e == null) return e;
265
+ let t = [];
266
+ for (let n of e) t.indexOf(n) === -1 && t.push(n);
267
+ return t;
268
+ }
269
+ function Ie(e) {
270
+ if (e == null) throw new z(`Invalid value in obj: ${JSON.stringify(e)}`);
271
+ for (let t in e) if (e.hasOwnProperty(t)) return !1;
272
+ return !0;
273
+ }
274
+ function W(e, t, n) {
275
+ if (n != null && e.indexOf(n) < 0) throw new z(`${n} is not a valid ${t}. Valid values are ${e} or null/undefined.`);
276
+ }
277
+ function Le(e, t, n = 0, r = Infinity) {
278
+ return V(n >= 0), V(r >= n), Array.isArray(e) && e.length >= n && e.length <= r && e.every((e) => typeof e === t);
279
+ }
280
+ function Re(e, t) {
281
+ Array.isArray(e) ? (h(e.length > 0, () => `${t} is unexpectedly an empty array.`), e.forEach((e, n) => Re(e, `element ${n + 1} of ${t}`))) : h(Number.isInteger(e) && e > 0, () => `Expected ${t} to be a positive integer, but got ${ze(e)}.`);
282
+ }
283
+ function ze(e) {
284
+ return e === null ? "null" : Array.isArray(e) ? "[" + e.map((e) => ze(e)).join(",") + "]" : typeof e == "string" ? `"${e}"` : `${e}`;
285
+ }
286
+ function Be(e, t, n) {
287
+ let r = n == null ? m() : n(), i;
288
+ return (...a) => {
289
+ let o = n == null ? m() : n();
290
+ return o - r < t || (r = o, i = e(...a)), i;
291
+ };
292
+ }
293
+ function Ve(e) {
294
+ return e === "relu" ? "relu" : e === "linear" ? "linear" : e === "elu" ? "elu" : null;
295
+ }
296
+ // node_modules/@tensorflow/tfjs-layers/dist/common.js
297
+ var G = /* @__PURE__ */ new Map();
298
+ function He(e) {
299
+ W(_e, "DataFormat", e);
300
+ }
301
+ function Ue(e) {
302
+ W(ve, "InterpolationFormat", e);
303
+ }
304
+ function We(e) {
305
+ W(ye, "PaddingMode", e);
306
+ }
307
+ function Ge(e) {
308
+ W(be, "PoolMode", e);
309
+ }
310
+ var K = [], q = "/";
311
+ function Ke(e, t) {
312
+ K.push(e);
313
+ try {
314
+ let e = t();
315
+ return K.pop(), e;
316
+ } catch (e) {
317
+ throw K.pop(), e;
318
+ }
319
+ }
320
+ function qe() {
321
+ return K.length === 0 ? "" : K.join(q) + q;
322
+ }
323
+ function Je(e) {
324
+ if (!J(e)) throw Error("Not a valid tensor name: '" + e + "'");
325
+ return qe() + e;
326
+ }
327
+ function Ye(e) {
328
+ if (!J(e)) throw Error("Not a valid tensor name: '" + e + "'");
329
+ G.has(e) || G.set(e, 0);
330
+ let t = G.get(e);
331
+ if (G.set(e, G.get(e) + 1), t > 0) {
332
+ let n = `${e}_${t}`;
333
+ return G.set(n, 1), n;
334
+ }
335
+ return e;
336
+ }
337
+ var Xe = /* @__PURE__ */ new RegExp(/^[A-Za-z0-9][-A-Za-z0-9\._\/]*$/);
338
+ function J(e) {
339
+ return !!e.match(Xe);
340
+ }
341
+ // node_modules/@tensorflow/tfjs-layers/dist/utils/math_utils.js
342
+ function Ze(e) {
343
+ return e === parseInt(e.toString(), 10);
344
+ }
345
+ function Y(e, t, n) {
346
+ t ??= 0, n ??= e.length;
347
+ let r = 1;
348
+ for (let i = t; i < n; ++i) r *= e[i];
349
+ return r;
350
+ }
351
+ function Qe(e) {
352
+ if (e.length === 0) return NaN;
353
+ let t = Infinity;
354
+ for (let n = 0; n < e.length; n++) {
355
+ let r = e[n];
356
+ r < t && (t = r);
357
+ }
358
+ return t;
359
+ }
360
+ function $e(e) {
361
+ if (e.length === 0) return NaN;
362
+ let t = -Infinity;
363
+ for (let n = 0; n < e.length; n++) {
364
+ let r = e[n];
365
+ r > t && (t = r);
366
+ }
367
+ return t;
368
+ }
369
+ function et(e, t) {
370
+ if (t < e) throw new z(`end (${t}) < begin (${e}) is forbidden.`);
371
+ let n = [];
372
+ for (let r = e; r < t; ++r) n.push(r);
373
+ return n;
374
+ }
375
+ // node_modules/@tensorflow/tfjs-layers/dist/backend/common.js
376
+ var tt;
377
+ function nt() {
378
+ return tt ??= g().epsilon(), tt;
379
+ }
380
+ function X() {
381
+ return "channelsLast";
382
+ }
383
+ // node_modules/@tensorflow/tfjs-layers/dist/backend/tfjs_backend.js
384
+ function rt(e, t) {
385
+ return n(e, t);
386
+ }
387
+ function it(e, t = -1) {
388
+ let n = e.shape.slice();
389
+ return t < 0 && (t = n.length + t + 1), n.splice(t, 0, 1), v(e, n);
390
+ }
391
+ function at(e, t) {
392
+ return a(() => {
393
+ if (e.shape.length !== 2) throw new z(`repeat() expects a rank-2 tensor, but received a rank-${e.shape.length} tensor.`);
394
+ return dt(it(e, 1), [
395
+ 1,
396
+ t,
397
+ 1
398
+ ]);
399
+ });
400
+ }
401
+ function ot(e) {
402
+ let t = [Y(e.shape)];
403
+ return v(e, t);
404
+ }
405
+ function st(e) {
406
+ if (e.rank <= 1) throw new z(`batchFlatten requires a minimum rank of 2. Got rank: ${e.rank}.`);
407
+ let t = [e.shape[0], Y(e.shape, 1)];
408
+ return v(e, t);
409
+ }
410
+ function Z(e, t, n) {
411
+ return a(() => {
412
+ switch (e.rank) {
413
+ case 1: return F(e, t, n);
414
+ case 2: return de(e, [t, 0], [n, e.shape[1]]);
415
+ case 3: return I(e, [
416
+ t,
417
+ 0,
418
+ 0
419
+ ], [
420
+ n,
421
+ e.shape[1],
422
+ e.shape[2]
423
+ ]);
424
+ case 4: return L(e, [
425
+ t,
426
+ 0,
427
+ 0,
428
+ 0
429
+ ], [
430
+ n,
431
+ e.shape[1],
432
+ e.shape[2],
433
+ e.shape[3]
434
+ ]);
435
+ case 5: return x(e, [
436
+ t,
437
+ 0,
438
+ 0,
439
+ 0,
440
+ 0
441
+ ], [
442
+ n,
443
+ e.shape[1],
444
+ e.shape[2],
445
+ e.shape[3],
446
+ e.shape[4]
447
+ ]);
448
+ case 6: return x(e, [
449
+ t,
450
+ 0,
451
+ 0,
452
+ 0,
453
+ 0,
454
+ 0
455
+ ], [
456
+ n,
457
+ e.shape[1],
458
+ e.shape[2],
459
+ e.shape[3],
460
+ e.shape[4],
461
+ e.shape[5]
462
+ ]);
463
+ default: throw new z(`sliceAlongFirstAxis() received an unsupported tensor rank: ${e.rank}`);
464
+ }
465
+ });
466
+ }
467
+ function Q(e, t, n) {
468
+ return a(() => {
469
+ switch (e.rank) {
470
+ case 1: return F(e, t, n);
471
+ case 2: return de(e, [0, t], [e.shape[0], n]);
472
+ case 3: return I(e, [
473
+ 0,
474
+ 0,
475
+ t
476
+ ], [
477
+ e.shape[0],
478
+ e.shape[1],
479
+ n
480
+ ]);
481
+ case 4: return L(e, [
482
+ 0,
483
+ 0,
484
+ 0,
485
+ t
486
+ ], [
487
+ e.shape[0],
488
+ e.shape[1],
489
+ e.shape[2],
490
+ n
491
+ ]);
492
+ default: throw new z(`sliceAlongLastAxis() received an unsupported tensor rank: ${e.rank}`);
493
+ }
494
+ });
495
+ }
496
+ function ct(e, t, n, r) {
497
+ return a(() => {
498
+ switch (e.rank) {
499
+ case 1: return F(e, t, n);
500
+ case 2: switch (r) {
501
+ case 1: return Z(e, t, n);
502
+ case 2: return Q(e, t, n);
503
+ default: throw new z(`The axis is not within the rank of the tensor ${r}`);
504
+ }
505
+ case 3: switch (r) {
506
+ case 1: return Z(e, t, n);
507
+ case 2: return I(e, [
508
+ 0,
509
+ t,
510
+ 0
511
+ ], [
512
+ e.shape[0],
513
+ n,
514
+ e.shape[2]
515
+ ]);
516
+ case 3: return Q(e, t, n);
517
+ default: throw new z(`The axis is not within the rank of the tensor ${r}`);
518
+ }
519
+ case 4: switch (r) {
520
+ case 1: return Z(e, t, n);
521
+ case 2: return L(e, [
522
+ 0,
523
+ t,
524
+ 0,
525
+ 0
526
+ ], [
527
+ e.shape[0],
528
+ n,
529
+ e.shape[2],
530
+ e.shape[3]
531
+ ]);
532
+ case 3: return L(e, [
533
+ 0,
534
+ 0,
535
+ t,
536
+ 0
537
+ ], [
538
+ e.shape[0],
539
+ e.shape[1],
540
+ n,
541
+ e.shape[3]
542
+ ]);
543
+ case 4: return Q(e, t, n);
544
+ default: throw new z(`The axis is not within the rank of the tensor ${r}`);
545
+ }
546
+ default: throw new z(`sliceAlongLastAxis() received an unsupported tensor rank: ${e.rank}`);
547
+ }
548
+ });
549
+ }
550
+ function lt(e, t = -1) {
551
+ let n;
552
+ return t < 0 && (n = e[0].rank, t = n === 0 ? 0 : n), t === e[0].rank && (t = -1), y(e, t);
553
+ }
554
+ function ut(e, t) {
555
+ switch (e.rank) {
556
+ case 1: return j([e, t]);
557
+ case 2: return N([e, t], 0);
558
+ case 3: return oe([e, t], 0);
559
+ case 4: return ce([e, t], 0);
560
+ default: throw new z(`concatAlongFirstAxis() received an unsupported tensor rank: ${e.rank}`);
561
+ }
562
+ }
563
+ function dt(e, t) {
564
+ if (Array.isArray(t) || (t = [t]), e.rank !== t.length) throw new z(`The length of input n (${t.length}) does not match the number of dimensions in input x (${e.rank})`);
565
+ return C(e, t);
566
+ }
567
+ function ft(e, t = 0, n = 1, r, i) {
568
+ return E(e, t, n, r, i);
569
+ }
570
+ function pt(e, t, n, r) {
571
+ if (e.rank < 2 || t.rank < 2) throw new B(`dot requires both inputs to be rank >= 2 but got x shape = ${e.shape} and y shape = ${t.shape}`);
572
+ if (t.rank >= 3 && e.shape.slice(-1)[0] !== t.shape.slice(-2)[0]) throw new B(`If rank y >= 3, then the second last dim of y must equal the last dim of x but got x shape = ${e.shape} and y shape = ${t.shape}`);
573
+ if (e.rank === 2 && t.rank === 2) return R({
574
+ a: e,
575
+ b: t,
576
+ transposeA: !1,
577
+ transposeB: !1,
578
+ bias: r ? $(e.rank, r, X()) : null,
579
+ activation: n
580
+ });
581
+ {
582
+ let i = e.shape.slice(), a = i.pop();
583
+ e = v(e, [-1, a]);
584
+ let o = t.shape.slice(), s = o.pop(), c = o.pop(), l = [...o, s], u = Array.from({ length: t.rank }, (e, n) => n === 0 ? t.rank - 2 : n <= t.rank - 2 ? n - 1 : n);
585
+ t = v(T(t, u), [c, -1]);
586
+ let d = [...i, ...l];
587
+ return v(R({
588
+ a: e,
589
+ b: t,
590
+ transposeA: !1,
591
+ transposeB: !1,
592
+ bias: r ? $(e.rank, r, X()) : null,
593
+ activation: n
594
+ }), d);
595
+ }
596
+ }
597
+ function mt(e, t, r) {
598
+ return a(() => (t = Array.isArray(t) ? k(t, "int32") : n(t, "int32"), w(e, t, r)));
599
+ }
600
+ function ht(e) {
601
+ return r(e, e);
602
+ }
603
+ function $(e, t, n) {
604
+ let r = t.shape;
605
+ if (t.rank !== 1 && t.rank !== e) throw new z(`Unexpected bias dimensions: ${t.rank}; expected it to be 1 or ${e}`);
606
+ if (e === 5) {
607
+ if (n === "channelsFirst") return r.length === 1 ? v(t, [
608
+ 1,
609
+ r[0],
610
+ 1,
611
+ 1,
612
+ 1
613
+ ]) : v(t, [
614
+ 1,
615
+ r[3],
616
+ r[0],
617
+ r[1],
618
+ r[2]
619
+ ]);
620
+ if (n === "channelsLast") return r.length === 1 ? v(t, [
621
+ 1,
622
+ 1,
623
+ 1,
624
+ 1,
625
+ r[0]
626
+ ]) : v(t, [1].concat(r));
627
+ } else if (e === 4) {
628
+ if (n === "channelsFirst") return r.length === 1 ? v(t, [
629
+ 1,
630
+ r[0],
631
+ 1,
632
+ 1
633
+ ]) : v(t, [
634
+ 1,
635
+ r[2],
636
+ r[0],
637
+ r[1]
638
+ ]);
639
+ if (n === "channelsLast") return r.length === 1 ? v(t, [
640
+ 1,
641
+ 1,
642
+ 1,
643
+ r[0]
644
+ ]) : v(t, [1].concat(r));
645
+ } else if (e === 3) {
646
+ if (n === "channelsFirst") return r.length === 1 ? v(t, [
647
+ 1,
648
+ r[0],
649
+ 1
650
+ ]) : v(t, [
651
+ 1,
652
+ r[1],
653
+ r[0]
654
+ ]);
655
+ if (n === "channelsLast") return r.length === 1 ? v(t, [
656
+ 1,
657
+ 1,
658
+ r[0]
659
+ ]) : v(t, [1].concat(r));
660
+ } else if (e < 3) return t;
661
+ throw new z(`Unsupported input rank by biasAdd: ${t.rank}`);
662
+ }
663
+ function gt(e, t, n) {
664
+ return a(() => (n ??= X(), He(n), c(e, $(e.rank, t, n))));
665
+ }
666
+ function _t(e, t = 1) {
667
+ if (t !== 1) throw new B(`Support for alpha values other than 1 (${t}) is not implemented yet.`);
668
+ return _(e);
669
+ }
670
+ function vt(e) {
671
+ return a(() => l(e, c(t(e), 1)));
672
+ }
673
+ function yt(e, t, n, r) {
674
+ return a(() => he(e, t, n, r));
675
+ }
676
+ function bt(e) {
677
+ return a(() => {
678
+ let t = c(.5, r(.2, e));
679
+ return S(t, 0, 1);
680
+ });
681
+ }
682
+ function xt(e, t, n = !1) {
683
+ return n ? e() : t();
684
+ }
685
+ export { B as $, We as A, Be as B, Y as C, et as D, Qe as E, V as F, Pe as G, Ie as H, Re as I, Ae as J, je as K, Le as L, Je as M, Ye as N, He as O, Ke as P, Se as Q, W as R, X as S, $e as T, Ve as U, Me as V, Te as W, ke as X, Oe as Y, Fe as Z, Z as _, lt as a, dt as b, _t as c, mt as d, Ce as et, bt as f, ct as g, at as h, ut as i, Ge as j, Ue as k, it as l, ft as m, gt as n, xe as nt, pt as o, xt as p, De as q, rt as r, yt as s, st as t, z as tt, ot as u, vt as v, Ze as w, nt as x, ht as y, Ee as z };
@@ -0,0 +1,10 @@
1
+ import { Q as e, Z as t, ci as n, rt as r, yi as i } from "./dist-CMMLi-qO.js";
2
+ // node_modules/@tensorflow/tfjs-core/dist/ops/tile.js
3
+ function a(t, a) {
4
+ let o = e(t, "x", "tile", "string_or_numeric");
5
+ i(o.rank === a.length, () => `Error in transpose: rank of input ${o.rank} must match length of reps ${a}.`);
6
+ let s = { x: o }, c = { reps: a };
7
+ return r.runKernel(n, s, c);
8
+ }
9
+ var o = /* @__PURE__ */ t({ tile_: a });
10
+ export { o as t };
@@ -0,0 +1,14 @@
1
+ import { n as e } from "./rolldown-runtime-CwxnZyOB.js";
2
+ import t from "./tokeniser/CharTokeniser.js";
3
+ import n from "./tokeniser/bpe.js";
4
+ import { tokensFromStreams as r } from "./training/tasks/tokenStream.js";
5
+ import { TokenStore as i, createTokenStore as a } from "./training/tasks/TokenStore.js";
6
+ // lib/tokenise.ts
7
+ var o = /* @__PURE__ */ e({
8
+ BPETokeniser: () => n,
9
+ CharTokeniser: () => t,
10
+ TokenStore: () => i,
11
+ createTokenStore: () => a,
12
+ tokensFromStreams: () => r
13
+ });
14
+ export { o as t };