@genai-fi/nanogpt 0.10.1 → 0.10.2

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 (206) hide show
  1. package/dist/Generator.js +14 -14
  2. package/dist/{RealDiv-DgA3z9oO.js → RealDiv-zz7FpkKX.js} +17 -17
  3. package/dist/{Reshape-CF6odzV4.js → Reshape-CDVLyVfz.js} +3 -3
  4. package/dist/{Reshape-_kILl6tK.js → Reshape-CHdUjC72.js} +4 -4
  5. package/dist/TeachableLLM.js +8 -8
  6. package/dist/{axis_util-BvHEw88j.js → axis_util-BsIr9ZNu.js} +1 -1
  7. package/dist/backend.js +2 -2
  8. package/dist/{backend_util-D-rUb2ty.js → backend_util-B1XRLuq9.js} +31 -31
  9. package/dist/{backend_webgpu-B0u2ndUn.js → backend_webgpu-CqpfEImu.js} +5 -5
  10. package/dist/{broadcast_to-CwF7XIeu.js → broadcast_to-B0ChcDaz.js} +4 -4
  11. package/dist/checks/appendCache.js +2 -2
  12. package/dist/checks/attentionMask.js +3 -3
  13. package/dist/checks/gelu.js +2 -2
  14. package/dist/checks/matMulGelu.js +5 -5
  15. package/dist/checks/normRMS.js +4 -4
  16. package/dist/checks/normRMSGrad.js +3 -3
  17. package/dist/checks/packUnpack.js +2 -2
  18. package/dist/checks/qkv.js +3 -3
  19. package/dist/checks/rope.js +2 -2
  20. package/dist/{complex-CSlYz-2T.js → complex-BBiRlsVq.js} +3 -3
  21. package/dist/{concat-BHlIJeyT.js → concat-DmBLPVGC.js} +3 -3
  22. package/dist/{concat_util-DcJk7YHS.js → concat_util-iBYIyuQe.js} +1 -1
  23. package/dist/{dataset-0xP8GjwI.js → dataset-D2P7rHAw.js} +5 -5
  24. package/dist/{dropout-C1pM3f11.js → dropout-B1x1kYMa.js} +3 -3
  25. package/dist/{expand_dims-BPG4fwBP.js → expand_dims-ouvfxQ1n.js} +3 -3
  26. package/dist/{exports_initializers-xuidcwI4.js → exports_initializers-CZSUJoVE.js} +1 -1
  27. package/dist/{gather-DykLGqmW.js → gather-CH9sdacz.js} +2 -2
  28. package/dist/{gelu-CNLFZWea.js → gelu-Bmhopi0J.js} +2 -2
  29. package/dist/{gpgpu_math-DDVJCn6-.js → gpgpu_math-DsCcikas.js} +3 -3
  30. package/dist/{index-ZyQhjEPo.js → index-D6Q1lPZO.js} +55 -55
  31. package/dist/{index-CjOj7j-u.js → index-DRyE072i.js} +15 -15
  32. package/dist/{kernel_funcs_utils-Dg_-E44D.js → kernel_funcs_utils-CWfOAPGO.js} +9 -9
  33. package/dist/layers/BaseLayer.js +10 -10
  34. package/dist/layers/CausalSelfAttention.js +6 -6
  35. package/dist/layers/MLP.js +4 -4
  36. package/dist/layers/PositionEmbedding.js +5 -5
  37. package/dist/layers/RMSNorm.js +3 -3
  38. package/dist/layers/RoPECache.js +4 -4
  39. package/dist/layers/TiedEmbedding.js +6 -6
  40. package/dist/layers/TransformerBlock.js +1 -1
  41. package/dist/loader/loadTransformers.js +1 -1
  42. package/dist/loader/oldZipLoad.js +8 -8
  43. package/dist/{log_sum_exp-DWI-76TI.js → log_sum_exp-D3ftBNY5.js} +6 -6
  44. package/dist/main.js +8 -8
  45. package/dist/{matMul16--R5hOwDG.js → matMul16-fEAJ4smh.js} +4 -4
  46. package/dist/{mat_mul-DeAh4uTH.js → mat_mul-C59XWcJd.js} +2 -2
  47. package/dist/{mod-Gt1rMB4n.js → mod-DESSvHIU.js} +2 -2
  48. package/dist/models/NanoGPTV1.js +2 -2
  49. package/dist/models/model.js +8 -8
  50. package/dist/{mulmat_packed_gpu-BMFhLwta.js → mulmat_packed_gpu-Coh6qbJk.js} +1 -1
  51. package/dist/{ones-CAMiP4I2.js → ones-jU9jlQvM.js} +4 -4
  52. package/dist/ops/adamAdjust.js +1 -1
  53. package/dist/ops/adamMoments.js +1 -1
  54. package/dist/ops/add16.js +1 -1
  55. package/dist/ops/appendCache.js +3 -3
  56. package/dist/ops/attentionMask.js +1 -1
  57. package/dist/ops/concat16.js +2 -2
  58. package/dist/ops/cpu/adamAdjust.js +2 -2
  59. package/dist/ops/cpu/adamMoments.js +3 -3
  60. package/dist/ops/cpu/appendCache.js +3 -3
  61. package/dist/ops/cpu/attentionMask.js +6 -6
  62. package/dist/ops/cpu/fusedSoftmax.js +3 -3
  63. package/dist/ops/cpu/gatherSub.js +4 -4
  64. package/dist/ops/cpu/gelu.js +2 -2
  65. package/dist/ops/cpu/matMul16.js +3 -3
  66. package/dist/ops/cpu/matMulGelu.js +4 -4
  67. package/dist/ops/cpu/matMulMul.js +2 -2
  68. package/dist/ops/cpu/mulDropout.js +2 -2
  69. package/dist/ops/cpu/normRMS.js +2 -2
  70. package/dist/ops/cpu/qkv.js +4 -4
  71. package/dist/ops/cpu/rope.js +6 -6
  72. package/dist/ops/cpu/scatterSub.js +7 -7
  73. package/dist/ops/dot16.js +2 -2
  74. package/dist/ops/gatherSub.js +1 -1
  75. package/dist/ops/gelu.js +2 -2
  76. package/dist/ops/grads/add16.js +2 -2
  77. package/dist/ops/grads/attentionMask.js +3 -3
  78. package/dist/ops/grads/gelu.js +3 -3
  79. package/dist/ops/grads/matMul16.js +4 -4
  80. package/dist/ops/grads/matMulGelu.js +2 -2
  81. package/dist/ops/grads/normRMS.js +2 -2
  82. package/dist/ops/grads/pack16.js +4 -4
  83. package/dist/ops/grads/qkv.js +4 -4
  84. package/dist/ops/grads/rope.js +3 -3
  85. package/dist/ops/grads/softmax16.js +2 -2
  86. package/dist/ops/grads/unpack16.js +3 -3
  87. package/dist/ops/matMul16.js +3 -3
  88. package/dist/ops/matMulGelu.js +1 -1
  89. package/dist/ops/matMulMul.js +1 -1
  90. package/dist/ops/mul16.js +1 -1
  91. package/dist/ops/mulDrop.js +1 -1
  92. package/dist/ops/normRMS.js +1 -1
  93. package/dist/ops/pack16.js +2 -2
  94. package/dist/ops/qkv.js +1 -1
  95. package/dist/ops/reshape16.js +3 -3
  96. package/dist/ops/rope.js +5 -5
  97. package/dist/ops/scatterSub.js +1 -1
  98. package/dist/ops/slice16.js +2 -2
  99. package/dist/ops/softmax16.js +1 -1
  100. package/dist/ops/sub16.js +1 -1
  101. package/dist/ops/sum16.js +2 -2
  102. package/dist/ops/transpose16.js +4 -4
  103. package/dist/ops/unpack16.js +2 -2
  104. package/dist/ops/webgl/adamAdjust.js +3 -3
  105. package/dist/ops/webgl/adamMoments.js +2 -2
  106. package/dist/ops/webgl/appendCache.js +2 -2
  107. package/dist/ops/webgl/attentionMask.js +2 -2
  108. package/dist/ops/webgl/fusedSoftmax.js +6 -6
  109. package/dist/ops/webgl/gatherSub.js +2 -2
  110. package/dist/ops/webgl/gelu.js +3 -3
  111. package/dist/ops/webgl/log.js +4 -4
  112. package/dist/ops/webgl/matMul16.js +5 -5
  113. package/dist/ops/webgl/matMulGelu.js +6 -6
  114. package/dist/ops/webgl/matMulMul.js +2 -2
  115. package/dist/ops/webgl/mulDropout.js +2 -2
  116. package/dist/ops/webgl/normRMS.js +3 -3
  117. package/dist/ops/webgl/qkv.js +2 -2
  118. package/dist/ops/webgl/rope.js +2 -2
  119. package/dist/ops/webgl/scatterSub.js +2 -2
  120. package/dist/ops/webgpu/adamAdjust.js +5 -5
  121. package/dist/ops/webgpu/adamMoments.js +5 -5
  122. package/dist/ops/webgpu/add16.js +2 -2
  123. package/dist/ops/webgpu/appendCache.js +5 -5
  124. package/dist/ops/webgpu/attentionMask.js +4 -4
  125. package/dist/ops/webgpu/attentionMask32_program.js +2 -2
  126. package/dist/ops/webgpu/concat16.js +7 -7
  127. package/dist/ops/webgpu/gatherSub.js +5 -5
  128. package/dist/ops/webgpu/gelu.js +4 -4
  129. package/dist/ops/webgpu/matMul16.js +6 -6
  130. package/dist/ops/webgpu/matMul16_program.js +3 -3
  131. package/dist/ops/webgpu/mul16.js +2 -2
  132. package/dist/ops/webgpu/normRMS.js +4 -4
  133. package/dist/ops/webgpu/normRMSGrad.js +6 -6
  134. package/dist/ops/webgpu/pack16.js +2 -2
  135. package/dist/ops/webgpu/pack16_program.js +2 -2
  136. package/dist/ops/webgpu/qkv.js +4 -4
  137. package/dist/ops/webgpu/rope.js +5 -5
  138. package/dist/ops/webgpu/scatterSub.js +5 -5
  139. package/dist/ops/webgpu/slice16.js +6 -6
  140. package/dist/ops/webgpu/softmax16.js +4 -4
  141. package/dist/ops/webgpu/softmax16_program.js +2 -2
  142. package/dist/ops/webgpu/softmax16_subgroup_program.js +2 -2
  143. package/dist/ops/webgpu/softmax16grad.js +2 -2
  144. package/dist/ops/webgpu/sub16.js +2 -2
  145. package/dist/ops/webgpu/sum16.js +5 -5
  146. package/dist/ops/webgpu/transpose16.js +3 -3
  147. package/dist/ops/webgpu/transpose16_program.js +2 -2
  148. package/dist/ops/webgpu/transpose16_shared_program.js +4 -4
  149. package/dist/ops/webgpu/unpack16.js +4 -4
  150. package/dist/ops/webgpu/utils/binary_op.js +4 -4
  151. package/dist/ops/webgpu/utils/reductions.js +5 -5
  152. package/dist/{ops-CNI3TwqM.js → ops-BFDtP6th.js} +24 -24
  153. package/dist/{pack16-CFUqumar.js → pack16-CmVZs6af.js} +3 -3
  154. package/dist/patches/PackedTensor.js +1 -1
  155. package/dist/patches/engine.js +7 -5
  156. package/dist/patches/tape.js +1 -1
  157. package/dist/patches/webgpu_backend.js +5 -5
  158. package/dist/patches/webgpu_base.js +1 -1
  159. package/dist/patches/webgpu_program.js +3 -3
  160. package/dist/{random_width-DY6Kk2Dl.js → random_width-BVV9HveY.js} +31 -31
  161. package/dist/{range-BMS52eQi.js → range-ZZZD60Fx.js} +2 -2
  162. package/dist/{reciprocal-CTmshQ9J.js → reciprocal-CrYlsAGD.js} +2 -2
  163. package/dist/{register_all_kernels-Bwu1PTuU.js → register_all_kernels-nvj2k7OC.js} +41 -41
  164. package/dist/{relu-yZ2-7WxU.js → relu-BYDneVPn.js} +2 -2
  165. package/dist/{reshape-DevtBWtf.js → reshape-CaPQzFvz.js} +2 -2
  166. package/dist/{rope-B5UUMsPi.js → rope-s4W2XO9B.js} +5 -5
  167. package/dist/{scatter_nd_util-5EL-8VAQ.js → scatter_nd_util-C7zXRT_h.js} +1 -1
  168. package/dist/{selu_util-D1w6yyTO.js → selu_util-BGPXmd4B.js} +16 -16
  169. package/dist/{shared-BRksrJb3.js → shared-CHhxz-O5.js} +1 -1
  170. package/dist/{shared-BuAXb4CI.js → shared-D2NP_CpY.js} +8 -8
  171. package/dist/{sin-BGfy2HZo.js → sin-Djs4aQiu.js} +2 -2
  172. package/dist/{slice-D_gkkqZK.js → slice-DvovR5wq.js} +2 -2
  173. package/dist/{slice_util-DtEldBfK.js → slice_util-DyjSAD0u.js} +1 -1
  174. package/dist/{softmax-ZHVebtR1.js → softmax-C9JQEtnO.js} +2 -2
  175. package/dist/{split-DrfihRpZ.js → split-DBck65sX.js} +2 -2
  176. package/dist/{squeeze-DZEpeblb.js → squeeze-C00Ipm_7.js} +3 -3
  177. package/dist/{stack-yOIAalTq.js → stack-ChnHwRpX.js} +3 -3
  178. package/dist/{sum-_fzj5ZTB.js → sum-ywRJj3Zr.js} +2 -2
  179. package/dist/{tensor-f35l8Odg.js → tensor-0r5yOo2R.js} +1 -1
  180. package/dist/{tensor-DdQUJZlz.js → tensor-CzmOBsdf.js} +21 -21
  181. package/dist/{tensor1d-CeZuc-Rv.js → tensor1d-BlUT89BP.js} +2 -2
  182. package/dist/{tensor2d-G4Ys2GxX.js → tensor2d-CSB4KOb0.js} +2 -2
  183. package/dist/{tensor4d-B8roDgtc.js → tensor4d-D7bLqGqz.js} +2 -2
  184. package/dist/{tensor_util-DV-FP5Q3.js → tensor_util-DfwaWayG.js} +12 -12
  185. package/dist/{tfjs_backend-kNyO5L2d.js → tfjs_backend-CNkSTL0c.js} +38 -38
  186. package/dist/{tile-BzyEiF-F.js → tile-CR074jmp.js} +3 -3
  187. package/dist/training/Adam.js +2 -2
  188. package/dist/training/AdamExt.js +1 -1
  189. package/dist/training/DatasetBuilder.js +2 -2
  190. package/dist/training/FullTrainer.js +1 -1
  191. package/dist/training/Trainer.js +2 -2
  192. package/dist/training/sparseCrossEntropy.js +3 -3
  193. package/dist/{transpose-DKELTqhe.js → transpose-DH4gmHvu.js} +4 -4
  194. package/dist/utilities/dummy.js +3 -3
  195. package/dist/utilities/multinomialCPU.js +2 -2
  196. package/dist/utilities/packed.js +338 -304
  197. package/dist/utilities/performance.js +1 -1
  198. package/dist/utilities/profile.js +1 -1
  199. package/dist/utilities/safetensors.js +2 -2
  200. package/dist/utilities/sentences.js +5 -5
  201. package/dist/utilities/weights.js +2 -2
  202. package/dist/{variable-Bhn5bHYv.js → variable-DzfrwYuP.js} +1 -1
  203. package/dist/{webgpu_program-Cigz-7RF.js → webgpu_program-DzaQiqel.js} +2 -2
  204. package/dist/{webgpu_util-BBCnKm2X.js → webgpu_util-0_ubCEHJ.js} +2 -2
  205. package/dist/{zeros-2gldETuK.js → zeros-DBFVbpv5.js} +3 -3
  206. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
- import { K as z, L as oe, M as ie, N as ae, P as me, Q as J, h as $e } from "./index-ZyQhjEPo.js";
2
- import { e as v, a as F, i as B, h as I, b as T, s as E, J as H, K as Te, G as Y } from "./tensor-DdQUJZlz.js";
1
+ import { K as z, L as oe, M as ie, N as ae, P as me, Q as J, h as $e } from "./index-D6Q1lPZO.js";
2
+ import { e as v, a as F, i as B, h as I, b as T, s as E, I as H, J as Te, F as Y } from "./tensor-CzmOBsdf.js";
3
3
  import "./index-Cp39cXWe.js";
4
- import { b as Se } from "./backend_util-D-rUb2ty.js";
4
+ import { b as Se } from "./backend_util-B1XRLuq9.js";
5
5
  const Re = "model", Ee = ".json", Ce = ".weights.bin";
6
6
  function K(e) {
7
7
  return new Promise((t) => setTimeout(t)).then(e);
@@ -1,5 +1,5 @@
1
- import { w as J, o as je, p as ge, K as qe, I as Ee, q as pe, s as ye, t as Te, v as Ve, a3 as He, x as Ae, A as Me, a4 as Ne, a5 as xe, m as G, a6 as Xe, $ as Je, a7 as Ye, a8 as Ze, a9 as Qe, aa as et, ab as tt, ac as nt, ad as st, ae as rt, af as at } from "./tensor_util-DV-FP5Q3.js";
2
- import { o as it, E as ot, q as ct, y as lt, a as g, r as ut, t as ht, T as R, u as dt, V as re, v as ae, w as Y, x as be, f as ft, m as mt, s as Z, e as B, M as gt, N as ue, D, O as Fe, B as De, P as pt, d as he, Q as yt, R as bt, S as wt, U as St, j as Ce } from "./tensor-DdQUJZlz.js";
1
+ import { w as J, o as je, p as ge, K as qe, I as Ee, q as pe, s as ye, t as Te, v as Ve, a3 as He, x as Ae, A as Me, a4 as Ne, a5 as xe, m as G, a6 as Xe, $ as Je, a7 as Ye, a8 as Ze, a9 as Qe, aa as et, ab as tt, ac as nt, ad as st, ae as rt, af as at } from "./tensor_util-DfwaWayG.js";
2
+ import { L as it, E as ot, w as ct, x as lt, a as g, o as ut, q as ht, T as R, r as dt, V as re, t as ae, u as Y, v as be, f as ft, m as mt, s as Z, e as B, M as gt, N as ue, C, O as Fe, A as Ce, P as pt, d as he, Q as yt, R as bt, S as wt, U as St, j as De } from "./tensor-CzmOBsdf.js";
3
3
  import { p as Q } from "./index-xuotMAFm.js";
4
4
  import { B as ee } from "./index-Cp39cXWe.js";
5
5
  function ne(s) {
@@ -602,7 +602,7 @@ E.registerFlag("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU", () => !1);
602
602
  E.registerFlag("USE_SETTIMEOUTCUSTOM", () => !1);
603
603
  function Et(s, e) {
604
604
  let t = s;
605
- if (D(s))
605
+ if (C(s))
606
606
  return e === "string" ? [] : [s.length];
607
607
  if (Ne(s)) {
608
608
  const r = s.channels || "RGBA";
@@ -612,12 +612,12 @@ function Et(s, e) {
612
612
  if (!Array.isArray(s))
613
613
  return [];
614
614
  const n = [];
615
- for (; Array.isArray(t) || D(t) && e !== "string"; )
615
+ for (; Array.isArray(t) || C(t) && e !== "string"; )
616
616
  n.push(t.length), t = t[0];
617
617
  return Array.isArray(s) && B().getBool("TENSORLIKE_CHECK_SHAPE_CONSISTENCY") && $e(s, n, []), n;
618
618
  }
619
619
  function $e(s, e, t) {
620
- if (t = t || [], !Array.isArray(s) && !D(s)) {
620
+ if (t = t || [], !Array.isArray(s) && !C(s)) {
621
621
  g(e.length === 0, () => `Element arr[${t.join("][")}] is a primitive, but should be an array/TypedArray of ${e[0]} elements`);
622
622
  return;
623
623
  }
@@ -638,13 +638,13 @@ function S(s, e, t, n = "numeric") {
638
638
  if (s instanceof gt())
639
639
  return Se(n, s.dtype, e, t), s;
640
640
  let r = ue(s);
641
- if (r !== "string" && ["bool", "int32", "float32"].indexOf(n) >= 0 && (r = n), Se(n, r, e, t), s == null || !D(s) && !Array.isArray(s) && typeof s != "number" && typeof s != "boolean" && typeof s != "string") {
641
+ if (r !== "string" && ["bool", "int32", "float32"].indexOf(n) >= 0 && (r = n), Se(n, r, e, t), s == null || !C(s) && !Array.isArray(s) && typeof s != "number" && typeof s != "boolean" && typeof s != "string") {
642
642
  const c = s == null ? "null" : s.constructor.name;
643
643
  throw new Error(`Argument '${e}' passed to '${t}' must be a Tensor or TensorLike, but got '${c}'`);
644
644
  }
645
645
  const a = Et(s, r);
646
- !D(s) && !Array.isArray(s) && (s = [s]);
647
- const o = r !== "string" ? Fe(s, r) : De(s, [], !0);
646
+ !C(s) && !Array.isArray(s) && (s = [s]);
647
+ const o = r !== "string" ? Fe(s, r) : Ce(s, [], !0);
648
648
  return u.makeTensor(o, a, r);
649
649
  }
650
650
  function Tt(s, e, t, n = "numeric") {
@@ -681,7 +681,7 @@ function Mt(s, e, t, n) {
681
681
  throw new Error(`Creating tensor from GPU data only supports 'float32'|'int32' dtype, while the dtype is ${n}.`);
682
682
  return u.backend.createTensorFromGPUData(s, e || t, n);
683
683
  }
684
- if (!D(s) && !Array.isArray(s) && typeof s != "number" && typeof s != "boolean" && typeof s != "string")
684
+ if (!C(s) && !Array.isArray(s) && typeof s != "number" && typeof s != "boolean" && typeof s != "string")
685
685
  throw new Error("values passed to tensor(values) must be a number/boolean/string or an array of numbers/booleans/strings, or a TypedArray");
686
686
  if (e != null) {
687
687
  he(e);
@@ -692,7 +692,7 @@ function Mt(s, e, t, n) {
692
692
  g(t[i] === e[i] || !c, () => `Error creating a new Tensor. Inferred shape (${t}) does not match the provided shape (${e}). `);
693
693
  }
694
694
  }
695
- return !D(s) && !Array.isArray(s) && (s = [s]), e = e || t, s = n !== "string" ? Fe(s, n) : De(s, [], !0), u.makeTensor(s, e, n);
695
+ return !C(s) && !Array.isArray(s) && (s = [s]), e = e || t, s = n !== "string" ? Fe(s, n) : Ce(s, [], !0), u.makeTensor(s, e, n);
696
696
  }
697
697
  class H {
698
698
  /**
@@ -706,7 +706,7 @@ class H {
706
706
  return new H(e).slice();
707
707
  }
708
708
  constructor(e) {
709
- if (this.shards = [], this.previousShardIndex = 0, e == null || (e instanceof Array || (e = [e]), e = e.map((n) => D(n) ? n.buffer : n), e.length === 0))
709
+ if (this.shards = [], this.previousShardIndex = 0, e == null || (e instanceof Array || (e = [e]), e = e.map((n) => C(n) ? n.buffer : n), e.length === 0))
710
710
  return;
711
711
  this.bufferUniformSize = e[0].byteLength;
712
712
  let t = 0;
@@ -765,10 +765,10 @@ function Nt(s, e) {
765
765
  function _n() {
766
766
  u.disposeVariables();
767
767
  }
768
- function On() {
768
+ function Ln() {
769
769
  return u;
770
770
  }
771
- function Ln() {
771
+ function On() {
772
772
  return u.memory();
773
773
  }
774
774
  function k(s, e) {
@@ -840,7 +840,7 @@ const de = typeof ee < "u" && (typeof Blob > "u" || typeof atob > "u" || typeof
840
840
  function Ie(s) {
841
841
  return de ? ee.byteLength(s, "utf8") : new Blob([s]).size;
842
842
  }
843
- function Dt(s) {
843
+ function Ct(s) {
844
844
  if (de)
845
845
  return ee.from(s).toString("base64");
846
846
  const e = new Uint8Array(s);
@@ -849,7 +849,7 @@ function Dt(s) {
849
849
  t += String.fromCharCode(e[n]);
850
850
  return btoa(t);
851
851
  }
852
- function Ct(s) {
852
+ function Dt(s) {
853
853
  if (de) {
854
854
  const n = ee.from(s, "base64");
855
855
  return n.buffer.slice(n.byteOffset, n.byteOffset + n.byteLength);
@@ -965,8 +965,8 @@ class v {
965
965
  }
966
966
  }
967
967
  const Xn = (s) => v.getSaveHandlers(s);
968
- const ie = "tensorflowjs", oe = 1, O = "models_store", $ = "model_info_store";
969
- function Oe() {
968
+ const ie = "tensorflowjs", oe = 1, L = "models_store", $ = "model_info_store";
969
+ function Le() {
970
970
  if (!B().getBool("IS_BROWSER"))
971
971
  throw new Error("Failed to obtain IndexedDB factory because the current environmentis not a web browser.");
972
972
  const s = typeof window > "u" ? self : window, e = s.indexedDB || s.mozIndexedDB || s.webkitIndexedDB || s.msIndexedDB || s.shimIndexedDB;
@@ -976,11 +976,11 @@ function Oe() {
976
976
  }
977
977
  function ce(s) {
978
978
  const e = s.result;
979
- e.createObjectStore(O, { keyPath: "modelPath" }), e.createObjectStore($, { keyPath: "modelPath" });
979
+ e.createObjectStore(L, { keyPath: "modelPath" }), e.createObjectStore($, { keyPath: "modelPath" });
980
980
  }
981
981
  class z {
982
982
  constructor(e) {
983
- if (this.indexedDB = Oe(), e == null || !e)
983
+ if (this.indexedDB = Le(), e == null || !e)
984
984
  throw new Error("For IndexedDB, modelPath must not be null, undefined or empty.");
985
985
  this.modelPath = e;
986
986
  }
@@ -1012,7 +1012,7 @@ class z {
1012
1012
  a.onupgradeneeded = () => ce(a), a.onsuccess = () => {
1013
1013
  const i = a.result;
1014
1014
  if (t == null) {
1015
- const o = i.transaction(O, "readonly"), l = o.objectStore(O).get(this.modelPath);
1015
+ const o = i.transaction(L, "readonly"), l = o.objectStore(L).get(this.modelPath);
1016
1016
  l.onsuccess = () => {
1017
1017
  if (l.result == null)
1018
1018
  return i.close(), r(new Error(`Cannot find model with path '${this.modelPath}' in IndexedDB.`));
@@ -1029,8 +1029,8 @@ class z {
1029
1029
  }
1030
1030
  let m;
1031
1031
  h.onsuccess = () => {
1032
- m = i.transaction(O, "readwrite");
1033
- const d = m.objectStore(O);
1032
+ m = i.transaction(L, "readwrite");
1033
+ const d = m.objectStore(L);
1034
1034
  let p;
1035
1035
  try {
1036
1036
  p = d.put({
@@ -1055,18 +1055,18 @@ class z {
1055
1055
  }
1056
1056
  }
1057
1057
  z.URL_SCHEME = "indexeddb://";
1058
- const Le = (s) => B().getBool("IS_BROWSER") && !Array.isArray(s) && s.startsWith(z.URL_SCHEME) ? $t(s.slice(z.URL_SCHEME.length)) : null;
1059
- v.registerSaveRouter(Le);
1060
- v.registerLoadRouter(Le);
1058
+ const Oe = (s) => B().getBool("IS_BROWSER") && !Array.isArray(s) && s.startsWith(z.URL_SCHEME) ? $t(s.slice(z.URL_SCHEME.length)) : null;
1059
+ v.registerSaveRouter(Oe);
1060
+ v.registerLoadRouter(Oe);
1061
1061
  function $t(s) {
1062
1062
  return new z(s);
1063
1063
  }
1064
1064
  function _t(s) {
1065
1065
  return s.startsWith(z.URL_SCHEME) ? s.slice(z.URL_SCHEME.length) : s;
1066
1066
  }
1067
- class Ot {
1067
+ class Lt {
1068
1068
  constructor() {
1069
- this.indexedDB = Oe();
1069
+ this.indexedDB = Le();
1070
1070
  }
1071
1071
  async listModels() {
1072
1072
  return new Promise((e, t) => {
@@ -1093,8 +1093,8 @@ class Ot {
1093
1093
  return a.close(), n(new Error(`Cannot find model with path '${e}' in IndexedDB.`));
1094
1094
  {
1095
1095
  const h = o.delete(e), m = () => {
1096
- l = a.transaction(O, "readwrite");
1097
- const p = l.objectStore(O).delete(e);
1096
+ l = a.transaction(L, "readwrite");
1097
+ const p = l.objectStore(L).delete(e);
1098
1098
  p.onsuccess = () => t(c.result.modelArtifactsInfo), p.onerror = (b) => n(c.error);
1099
1099
  };
1100
1100
  h.onsuccess = m, h.onerror = (d) => (m(), a.close(), n(c.error));
@@ -1106,14 +1106,14 @@ class Ot {
1106
1106
  });
1107
1107
  }
1108
1108
  }
1109
- const C = "/", K = "tensorflowjs_models", ze = "info", Lt = "model_topology", zt = "weight_specs", Pt = "weight_data", Ut = "model_metadata";
1109
+ const D = "/", K = "tensorflowjs_models", ze = "info", Ot = "model_topology", zt = "weight_specs", Pt = "weight_data", Ut = "model_metadata";
1110
1110
  function Pe(s) {
1111
1111
  return {
1112
- info: [K, s, ze].join(C),
1113
- topology: [K, s, Lt].join(C),
1114
- weightSpecs: [K, s, zt].join(C),
1115
- weightData: [K, s, Pt].join(C),
1116
- modelMetadata: [K, s, Ut].join(C)
1112
+ info: [K, s, ze].join(D),
1113
+ topology: [K, s, Ot].join(D),
1114
+ weightSpecs: [K, s, zt].join(D),
1115
+ weightData: [K, s, Pt].join(D),
1116
+ modelMetadata: [K, s, Ut].join(D)
1117
1117
  };
1118
1118
  }
1119
1119
  function Ue(s) {
@@ -1121,10 +1121,10 @@ function Ue(s) {
1121
1121
  window.localStorage.removeItem(e);
1122
1122
  }
1123
1123
  function Gt(s) {
1124
- const e = s.split(C);
1124
+ const e = s.split(D);
1125
1125
  if (e.length < 3)
1126
1126
  throw new Error(`Invalid key format: ${s}`);
1127
- return e.slice(1, e.length - 1).join(C);
1127
+ return e.slice(1, e.length - 1).join(D);
1128
1128
  }
1129
1129
  function Wt(s) {
1130
1130
  return s.startsWith(P.URL_SCHEME) ? s.slice(P.URL_SCHEME.length) : s;
@@ -1152,7 +1152,7 @@ class P {
1152
1152
  {
1153
1153
  const t = JSON.stringify(e.modelTopology), n = JSON.stringify(e.weightSpecs), r = _e(e), a = H.join(e.weightData);
1154
1154
  try {
1155
- this.LS.setItem(this.keys.info, JSON.stringify(r)), this.LS.setItem(this.keys.topology, t), this.LS.setItem(this.keys.weightSpecs, n), this.LS.setItem(this.keys.weightData, Dt(a));
1155
+ this.LS.setItem(this.keys.info, JSON.stringify(r)), this.LS.setItem(this.keys.topology, t), this.LS.setItem(this.keys.weightSpecs, n), this.LS.setItem(this.keys.weightData, Ct(a));
1156
1156
  const i = {
1157
1157
  format: e.format,
1158
1158
  generatedBy: e.generatedBy,
@@ -1199,7 +1199,7 @@ class P {
1199
1199
  const i = this.LS.getItem(this.keys.weightData);
1200
1200
  if (i == null)
1201
1201
  throw new Error(`In local storage, the binary weight values of model '${this.modelPath}' are missing.`);
1202
- return t.weightData = Ct(i), t;
1202
+ return t.weightData = Dt(i), t;
1203
1203
  }
1204
1204
  }
1205
1205
  P.URL_SCHEME = "localstorage://";
@@ -1214,7 +1214,7 @@ class jt {
1214
1214
  g(B().getBool("IS_BROWSER"), () => "Current environment is not a web browser"), g(typeof window > "u" || typeof window.localStorage < "u", () => "Current browser does not appear to support localStorage"), this.LS = window.localStorage;
1215
1215
  }
1216
1216
  async listModels() {
1217
- const e = {}, t = K + C, n = C + ze;
1217
+ const e = {}, t = K + D, n = D + ze;
1218
1218
  for (let r = 0; r < this.LS.length; ++r) {
1219
1219
  const a = this.LS.key(r);
1220
1220
  if (a.startsWith(t) && a.endsWith(n)) {
@@ -1310,7 +1310,7 @@ if (B().get("IS_BROWSER")) {
1310
1310
  } catch {
1311
1311
  }
1312
1312
  try {
1313
- N.registerManager(z.URL_SCHEME, new Ot());
1313
+ N.registerManager(z.URL_SCHEME, new Lt());
1314
1314
  } catch {
1315
1315
  }
1316
1316
  }
@@ -1464,9 +1464,9 @@ function dn(s, e) {
1464
1464
  }
1465
1465
  const Be = /* @__PURE__ */ M({ pow_: dn });
1466
1466
  function U(s, e) {
1467
- if ((D(s) && e !== "string" || Array.isArray(s)) && e !== "complex64")
1467
+ if ((C(s) && e !== "string" || Array.isArray(s)) && e !== "complex64")
1468
1468
  throw new Error("Error creating a new Scalar: value must be a primitive (number|boolean|string)");
1469
- if (e === "string" && D(s) && !(s instanceof Uint8Array))
1469
+ if (e === "string" && C(s) && !(s instanceof Uint8Array))
1470
1470
  throw new Error("When making a scalar from encoded string, the value must be `Uint8Array`.");
1471
1471
  return Mt(s, [], [], e);
1472
1472
  }
@@ -1479,14 +1479,14 @@ function mn(s) {
1479
1479
  const e = S(s, "x", "square"), t = {};
1480
1480
  return u.runKernel("Square", { x: e }, t);
1481
1481
  }
1482
- const L = /* @__PURE__ */ M({ square_: mn });
1482
+ const O = /* @__PURE__ */ M({ square_: mn });
1483
1483
  function Zn(s) {
1484
1484
  return g(Y(s), () => "The f passed in grads(f) must be a function"), (e, t) => {
1485
1485
  g(Array.isArray(e), () => "The args passed in grads(f)(args) must be an array of `Tensor`s or `TensorLike`s");
1486
1486
  const n = Tt(e, "args", "tf.grads", "string_or_numeric"), r = t != null ? S(t, "dy", "tf.grads") : null;
1487
1487
  return u.tidy(() => {
1488
1488
  const { value: a, grads: i } = u.gradients(() => s(...n), n, r);
1489
- return r != null && Ce(a.shape, r.shape, "The shape of dy passed in grads(f)([x1,...], dy) must match the shape returned by f([x1,...])"), We(i), i;
1489
+ return r != null && De(a.shape, r.shape, "The shape of dy passed in grads(f)([x1,...], dy) must match the shape returned by f([x1,...])"), We(i), i;
1490
1490
  });
1491
1491
  };
1492
1492
  }
@@ -1494,7 +1494,7 @@ function Qn(s) {
1494
1494
  return g(Y(s), () => "The f passed in valueAndGrads(f) must be a function"), (e, t) => {
1495
1495
  g(Array.isArray(e) && e.every((r) => r instanceof R), () => "The args passed in valueAndGrads(f)(args) must be array of tensors"), g(t == null || t instanceof R, () => "The dy passed in valueAndGrads(f)(args, dy) must be a tensor");
1496
1496
  const n = u.gradients(() => s(...e), e, t);
1497
- return t != null && Ce(n.value.shape, t.shape, "The shape of dy passed in valueAndGrads(f)([x1,...], dy) must match the shape returned by f([x1,...])"), We(n.grads), n;
1497
+ return t != null && De(n.value.shape, t.shape, "The shape of dy passed in valueAndGrads(f)([x1,...], dy) must match the shape returned by f([x1,...])"), We(n.grads), n;
1498
1498
  };
1499
1499
  }
1500
1500
  function gn(s, e) {
@@ -1692,7 +1692,7 @@ class vn extends W {
1692
1692
  return;
1693
1693
  const c = this.accumulatedGrads[r].variable, l = this.accumulatedUpdates[r].variable;
1694
1694
  k(() => {
1695
- const h = y(f(c, this.rho), f(L(o), 1 - this.rho)), m = f(x(V(y(l, this.epsilon)), V(y(c, this.epsilon))), o), d = y(f(l, this.rho), f(L(m), 1 - this.rho));
1695
+ const h = y(f(c, this.rho), f(O(o), 1 - this.rho)), m = f(x(V(y(l, this.epsilon)), V(y(c, this.epsilon))), o), d = y(f(l, this.rho), f(O(m), 1 - this.rho));
1696
1696
  c.assign(h), l.assign(d);
1697
1697
  const p = y(f(m, -this.learningRate), a);
1698
1698
  a.assign(p);
@@ -1749,7 +1749,7 @@ class Bn extends W {
1749
1749
  return;
1750
1750
  const o = this.accumulatedGrads[r].variable;
1751
1751
  k(() => {
1752
- const c = y(o, L(i));
1752
+ const c = y(o, O(i));
1753
1753
  o.assign(c);
1754
1754
  const l = y(f(x(i, V(y(c, u.backend.epsilon()))), -this.learningRate), a);
1755
1755
  a.assign(l);
@@ -1804,7 +1804,7 @@ class En extends W {
1804
1804
  const l = Array.isArray(e) ? e[i].tensor : e[a];
1805
1805
  if (l == null)
1806
1806
  return;
1807
- const h = this.accumulatedFirstMoment[i].variable, m = this.accumulatedSecondMoment[i].variable, d = y(f(h, this.beta1), f(l, 1 - this.beta1)), p = y(f(m, this.beta2), f(L(l), 1 - this.beta2)), b = x(d, n), w = x(p, r);
1807
+ const h = this.accumulatedFirstMoment[i].variable, m = this.accumulatedSecondMoment[i].variable, d = y(f(h, this.beta1), f(l, 1 - this.beta1)), p = y(f(m, this.beta2), f(O(l), 1 - this.beta2)), b = x(d, n), w = x(p, r);
1808
1808
  h.assign(d), m.assign(p);
1809
1809
  const I = y(f(x(b, y(V(w), this.epsilon)), -this.learningRate), o);
1810
1810
  o.assign(I);
@@ -2026,14 +2026,14 @@ class Mn extends W {
2026
2026
  return;
2027
2027
  const c = this.accumulatedMeanSquares[r].variable, l = this.accumulatedMoments[r].variable;
2028
2028
  k(() => {
2029
- const h = y(f(c, this.decay), f(L(o), 1 - this.decay));
2029
+ const h = y(f(c, this.decay), f(O(o), 1 - this.decay));
2030
2030
  if (this.centered) {
2031
- const m = this.accumulatedMeanGrads[r].variable, d = y(f(m, this.decay), f(o, 1 - this.decay)), p = x(f(o, this.learningRate), V(j(h, y(L(d), this.epsilon)))), b = y(f(l, this.momentum), p);
2031
+ const m = this.accumulatedMeanGrads[r].variable, d = y(f(m, this.decay), f(o, 1 - this.decay)), p = x(f(o, this.learningRate), V(j(h, y(O(d), this.epsilon)))), b = y(f(l, this.momentum), p);
2032
2032
  c.assign(h), m.assign(d), l.assign(b);
2033
2033
  const w = j(a, b);
2034
2034
  a.assign(w);
2035
2035
  } else {
2036
- const m = y(f(c, this.decay), f(L(o), 1 - this.decay)), d = y(f(l, this.momentum), x(f(o, this.learningRate), V(y(m, this.epsilon))));
2036
+ const m = y(f(c, this.decay), f(O(o), 1 - this.decay)), d = y(f(l, this.momentum), x(f(o, this.learningRate), V(y(m, this.epsilon))));
2037
2037
  c.assign(m), l.assign(d);
2038
2038
  const p = j(a, d);
2039
2039
  a.assign(p);
@@ -2111,7 +2111,7 @@ export {
2111
2111
  Hn as Q,
2112
2112
  Wn as R,
2113
2113
  cn as S,
2114
- L as T,
2114
+ O as T,
2115
2115
  Ke as U,
2116
2116
  An as V,
2117
2117
  Mn as W,
@@ -2119,7 +2119,7 @@ export {
2119
2119
  vn as Y,
2120
2120
  Tn as Z,
2121
2121
  Bn as _,
2122
- Ln as a,
2122
+ On as a,
2123
2123
  In as a0,
2124
2124
  kn as a1,
2125
2125
  _ as a2,
@@ -2132,7 +2132,7 @@ export {
2132
2132
  U as b,
2133
2133
  j as c,
2134
2134
  A as d,
2135
- On as e,
2135
+ Ln as e,
2136
2136
  Gn as f,
2137
2137
  Un as g,
2138
2138
  Jn as h,
@@ -1,20 +1,20 @@
1
- import { W as Mt } from "./backend_webgpu-B0u2ndUn.js";
2
- import { f as Et, j, J as ke } from "./index-ZyQhjEPo.js";
3
- import { i as Ut, a as Ht, c as b, f as v, M as Y, b as at, d as rt, e as nt } from "./webgpu_util-BBCnKm2X.js";
4
- import { e as X, a as L, N as Gt, Z as Xt, s as D, l as Ye, b as De, p as te, Y as Kt, g as qt, i as ut, j as Yt, A as dt, f as jt } from "./tensor-DdQUJZlz.js";
1
+ import { W as Mt } from "./backend_webgpu-CqpfEImu.js";
2
+ import { f as Et, j, J as ke } from "./index-D6Q1lPZO.js";
3
+ import { i as Ut, a as Ht, c as b, f as v, M as Y, b as at, d as rt, e as nt } from "./webgpu_util-0_ubCEHJ.js";
4
+ import { e as X, a as L, N as Gt, Z as Xt, s as D, l as Ye, b as De, p as te, Y as Kt, g as qt, i as ut, j as Yt, z as dt, f as jt } from "./tensor-CzmOBsdf.js";
5
5
  import { g as _e, B as F } from "./binary_op_util-pKXltfxI.js";
6
- import { S as Qt, a as Zt, h as Ce, i as Ne, j as we, d as Q, e as Oe, g as Me, k as lt } from "./selu_util-D1w6yyTO.js";
7
- import { E as Jt, t as es, u as ts, w as ss, x as os, y as is, f as je, z as ct, A as ht, B as pt, C as as, D as rs, F as ns, G as us, H as ds, I as ls, J as cs, K as hs, L as ps, M as fs, N as ms, O as gs } from "./backend_util-D-rUb2ty.js";
8
- import { t as W, e as S, h as Z, b as G, c as Ie, P as ft, d as xs, a as Cs } from "./webgpu_program-Cigz-7RF.js";
9
- import { aa as ws, a2 as ys, I as Ss, h as bs, u as fe, a9 as vs, bi as ks, bj as Is, A as Rs, bk as Ps, H as $s, _ as Ds, aM as Ns, aN as zs, aO as As, bl as Fs, bm as Ws, bn as Ls, bp as Vs, bo as Bs, bq as Ts, y as _s, aq as Os, aP as Ms, aQ as Es, br as Us, bs as Hs, B as Gs, f as Xs, aS as Ks, ag as qs, bN as Ys, as as js, F as Qs, x as Zs, aG as Js, a1 as eo, a8 as to, D as so, C as oo, aU as io, be as ao, aV as ro, aW as no, bu as uo, aX as lo, l as co, aY as ho, aw as po, aZ as fo, a_ as mo, a$ as go, bO as xo, b0 as Co, bg as wo, bh as yo, bP as So, bv as bo, bw as vo, bx as ko, bQ as Io, a7 as Ro, g as Po, ai as $o, V as Do, by as No, aH as zo, b1 as Ao, z as Fo, E as Wo, aI as Lo, bR as Vo, ax as Bo, Q as To, a6 as _o, bS as Oo, aT as Mo, bf as Eo, bT as Uo, k as Ho, G as Go, ak as Xo, al as Ko, bU as qo, bz as Yo, bA as jo, bB as Qo, W as Zo, am as Jo, an as ei, bV as ti, L as si, ao as oi, ap as ii, b3 as ai, bW as ri, bE as ni, bD as ui, af as di, b4 as li, b5 as ci, bF as hi, bG as pi, bX as fi, aj as mi, ar as gi, bH as xi, M as Ci, S as wi, i as yi, N as Si, az as bi, aA as vi, b6 as ki, ab as Ii, b7 as Ri, P as Pi, b8 as $i, ac as Di, X as Ni, aJ as zi, R as Ai, $ as Fi, d as Wi, e as Li, Y as Vi, aC as Bi, bI as Ti, aD as _i, bJ as Oi, ba as Mi, ay as Ei, at as Ui, aK as Hi, j as Gi, bY as Xi, ah as Ki, bb as qi, U as Yi, bK as ji, n as Qi, bc as Zi, b2 as Ji, b9 as ea, bZ as ta, b_ as sa, T as oa, b$ as ia, c as aa, ad as ra, bL as na, au as ua, Z as da, c0 as la, c1 as ca, ae as ha, bM as pa, aR as fa, c2 as ma, c3 as ga, aE as xa, av as Ca, bd as wa, r as ya } from "./tensor_util-DV-FP5Q3.js";
10
- import { r as R, a as Sa } from "./Reshape-CF6odzV4.js";
11
- import { s as ba } from "./shared-BuAXb4CI.js";
12
- import { c as Ee, a as ye, b as Se, d as Ue, e as va, g as mt } from "./axis_util-BvHEw88j.js";
13
- import { p as ka, a as Ia, b as Ra, d as Pa } from "./slice_util-DtEldBfK.js";
14
- import { z as $a } from "./zeros-2gldETuK.js";
15
- import { c as me, a as Da } from "./concat_util-DcJk7YHS.js";
6
+ import { S as Qt, a as Zt, h as Ce, i as Ne, j as we, d as Q, e as Oe, g as Me, k as lt } from "./selu_util-BGPXmd4B.js";
7
+ import { E as Jt, t as es, u as ts, w as ss, x as os, y as is, f as je, z as ct, A as ht, B as pt, C as as, D as rs, F as ns, G as us, H as ds, I as ls, J as cs, K as hs, L as ps, M as fs, N as ms, O as gs } from "./backend_util-B1XRLuq9.js";
8
+ import { t as W, e as S, h as Z, b as G, c as Ie, P as ft, d as xs, a as Cs } from "./webgpu_program-DzaQiqel.js";
9
+ import { aa as ws, a2 as ys, I as Ss, h as bs, u as fe, a9 as vs, bi as ks, bj as Is, A as Rs, bk as Ps, H as $s, _ as Ds, aM as Ns, aN as zs, aO as As, bl as Fs, bm as Ws, bn as Ls, bp as Vs, bo as Bs, bq as Ts, y as _s, aq as Os, aP as Ms, aQ as Es, br as Us, bs as Hs, B as Gs, f as Xs, aS as Ks, ag as qs, bN as Ys, as as js, F as Qs, x as Zs, aG as Js, a1 as eo, a8 as to, D as so, C as oo, aU as io, be as ao, aV as ro, aW as no, bu as uo, aX as lo, l as co, aY as ho, aw as po, aZ as fo, a_ as mo, a$ as go, bO as xo, b0 as Co, bg as wo, bh as yo, bP as So, bv as bo, bw as vo, bx as ko, bQ as Io, a7 as Ro, g as Po, ai as $o, V as Do, by as No, aH as zo, b1 as Ao, z as Fo, E as Wo, aI as Lo, bR as Vo, ax as Bo, Q as To, a6 as _o, bS as Oo, aT as Mo, bf as Eo, bT as Uo, k as Ho, G as Go, ak as Xo, al as Ko, bU as qo, bz as Yo, bA as jo, bB as Qo, W as Zo, am as Jo, an as ei, bV as ti, L as si, ao as oi, ap as ii, b3 as ai, bW as ri, bE as ni, bD as ui, af as di, b4 as li, b5 as ci, bF as hi, bG as pi, bX as fi, aj as mi, ar as gi, bH as xi, M as Ci, S as wi, i as yi, N as Si, az as bi, aA as vi, b6 as ki, ab as Ii, b7 as Ri, P as Pi, b8 as $i, ac as Di, X as Ni, aJ as zi, R as Ai, $ as Fi, d as Wi, e as Li, Y as Vi, aC as Bi, bI as Ti, aD as _i, bJ as Oi, ba as Mi, ay as Ei, at as Ui, aK as Hi, j as Gi, bY as Xi, ah as Ki, bb as qi, U as Yi, bK as ji, n as Qi, bc as Zi, b2 as Ji, b9 as ea, bZ as ta, b_ as sa, T as oa, b$ as ia, c as aa, ad as ra, bL as na, au as ua, Z as da, c0 as la, c1 as ca, ae as ha, bM as pa, aR as fa, c2 as ma, c3 as ga, aE as xa, av as Ca, bd as wa, r as ya } from "./tensor_util-DfwaWayG.js";
10
+ import { r as R, a as Sa } from "./Reshape-CDVLyVfz.js";
11
+ import { s as ba } from "./shared-D2NP_CpY.js";
12
+ import { c as Ee, a as ye, b as Se, d as Ue, e as va, g as mt } from "./axis_util-BsIr9ZNu.js";
13
+ import { p as ka, a as Ia, b as Ra, d as Pa } from "./slice_util-DyjSAD0u.js";
14
+ import { z as $a } from "./zeros-DBFVbpv5.js";
15
+ import { c as me, a as Da } from "./concat_util-iBYIyuQe.js";
16
16
  import { n as Na, a as za } from "./non_max_suppression_impl-B2W7YjZB.js";
17
- import { c as He } from "./scatter_nd_util-5EL-8VAQ.js";
17
+ import { c as He } from "./scatter_nd_util-C7zXRT_h.js";
18
18
  Ut() && Et(
19
19
  "webgpu",
20
20
  async () => {
@@ -1,8 +1,8 @@
1
- import { j as B } from "./index-ZyQhjEPo.js";
2
- import { u as N, f as G } from "./gpgpu_math-DDVJCn6-.js";
3
- import { s as K, I as W, e as O } from "./tensor-DdQUJZlz.js";
4
- import { I as z, h as V, W as F, X as Y, u as S } from "./tensor_util-DV-FP5Q3.js";
5
- import { f as v } from "./backend_util-D-rUb2ty.js";
1
+ import { j as B } from "./index-D6Q1lPZO.js";
2
+ import { u as N, f as G } from "./gpgpu_math-DsCcikas.js";
3
+ import { s as K, H as W, e as O } from "./tensor-CzmOBsdf.js";
4
+ import { I as z, h as V, W as F, X as H, u as S } from "./tensor_util-DfwaWayG.js";
5
+ import { f as v } from "./backend_util-B1XRLuq9.js";
6
6
  const he = `
7
7
  if (isnan(a)) return a;
8
8
  if (isnan(b)) return b;
@@ -22,11 +22,11 @@ class b {
22
22
  `;
23
23
  }
24
24
  }
25
- function H(t, e) {
25
+ function Y(t, e) {
26
26
  return ["x", "y", "z", "w", "u", "v"].slice(0, e).map((s) => `${t}.${s}`);
27
27
  }
28
28
  function Z(t, e) {
29
- return e === 1 ? [t] : H(t, e);
29
+ return e === 1 ? [t] : Y(t, e);
30
30
  }
31
31
  function fe(t, e) {
32
32
  if (t === 1)
@@ -144,7 +144,7 @@ function j(t) {
144
144
  return s.runWebGLProgram(n, [r, u], "float32");
145
145
  }
146
146
  const Ne = {
147
- kernelName: Y,
147
+ kernelName: H,
148
148
  backendName: "webgl",
149
149
  kernelFunc: j
150
150
  };
@@ -293,7 +293,7 @@ export {
293
293
  ye as d,
294
294
  M as e,
295
295
  T as f,
296
- H as g,
296
+ Y as g,
297
297
  b as h,
298
298
  P as i,
299
299
  he as j,
@@ -1,7 +1,7 @@
1
- import { w as p, e as o, F as g } from "../index-ZyQhjEPo.js";
2
- import { v } from "../variable-Bhn5bHYv.js";
3
- import { T as _ } from "../tensor-DdQUJZlz.js";
4
- class T {
1
+ import { D as p, w as g, e as o, F as v } from "../index-D6Q1lPZO.js";
2
+ import { v as _ } from "../variable-DzfrwYuP.js";
3
+ import { T as V } from "../tensor-CzmOBsdf.js";
4
+ class F {
5
5
  parent;
6
6
  config;
7
7
  _variables = /* @__PURE__ */ new Map();
@@ -70,7 +70,7 @@ class T {
70
70
  }
71
71
  saveWeights(t) {
72
72
  this._variables.forEach((r, e) => {
73
- r && t.set(e, [r.clone()]);
73
+ r && t.set(e, [p(r)]);
74
74
  }), this.children.forEach((r) => {
75
75
  r.saveWeights(t);
76
76
  });
@@ -80,7 +80,7 @@ class T {
80
80
  const i = t.get(e)?.[0];
81
81
  if (!i)
82
82
  throw new Error(`Weights for ${e} not found`);
83
- r ? r.assign(i) : this._variables.set(e, v(i, this._trainable));
83
+ r ? r.assign(i) : this._variables.set(e, _(i, this._trainable));
84
84
  }), this.children.forEach((r) => {
85
85
  r.loadWeights(t);
86
86
  });
@@ -98,7 +98,7 @@ class T {
98
98
  call(t, ...r) {
99
99
  this.build();
100
100
  const e = this.forward(t, ...r);
101
- if (t.training && e instanceof _) {
101
+ if (t.training && e instanceof V) {
102
102
  const i = this.dropout(e);
103
103
  return i !== e && e.dispose(), i;
104
104
  } else
@@ -108,12 +108,12 @@ class T {
108
108
  return this.build(), this.checkpointingFn(t, ...r);
109
109
  }
110
110
  checkpointingFn(t, ...r) {
111
- const e = this.trainableVariables, s = p((...a) => {
111
+ const e = this.trainableVariables, s = g((...a) => {
112
112
  const l = a[a.length - 1], n = a.slice(0, r.length), h = this.forward(t, ...n);
113
113
  return l(n), { value: h, gradFunc: (c, f) => {
114
114
  const u = o().state.activeTape;
115
115
  o().state.activeTape = [];
116
- const b = g((...d) => this.forward(t, ...d.slice(0, n.length)))([...f, ...e], c);
116
+ const b = v((...d) => this.forward(t, ...d.slice(0, n.length)))([...f, ...e], c);
117
117
  return o().state.activeTape = u, b;
118
118
  } };
119
119
  })(...r, ...e);
@@ -125,5 +125,5 @@ class T {
125
125
  }
126
126
  }
127
127
  export {
128
- T as default
128
+ F as default
129
129
  };
@@ -1,18 +1,18 @@
1
1
  import { attentionMask as P } from "../ops/attentionMask.js";
2
2
  import _ from "./BaseLayer.js";
3
- import { r as k } from "../rope-B5UUMsPi.js";
3
+ import { r as k } from "../rope-s4W2XO9B.js";
4
4
  import { appendCache as b } from "../ops/appendCache.js";
5
- import { k as u, t as S } from "../index-ZyQhjEPo.js";
5
+ import { k as u, t as S } from "../index-D6Q1lPZO.js";
6
6
  import { softmax16 as C } from "../ops/softmax16.js";
7
- import { b as R } from "../matMul16--R5hOwDG.js";
8
- import { p as V } from "../pack16-CFUqumar.js";
7
+ import { b as R } from "../matMul16-fEAJ4smh.js";
8
+ import { p as V } from "../pack16-CmVZs6af.js";
9
9
  import { transpose16 as J } from "../ops/transpose16.js";
10
10
  import { dot16 as L } from "../ops/dot16.js";
11
11
  import { reshape16 as N } from "../ops/reshape16.js";
12
12
  import { isPackedTensor as l } from "../utilities/packed.js";
13
13
  import { qkv as j } from "../ops/qkv.js";
14
- import { v as T } from "../variable-Bhn5bHYv.js";
15
- import { r as v, d as y } from "../dropout-C1pM3f11.js";
14
+ import { v as T } from "../variable-DzfrwYuP.js";
15
+ import { r as v, d as y } from "../dropout-B1x1kYMa.js";
16
16
  class X extends _ {
17
17
  divisor;
18
18
  index;
@@ -1,9 +1,9 @@
1
- import { t as p } from "../index-ZyQhjEPo.js";
1
+ import { t as p } from "../index-D6Q1lPZO.js";
2
2
  import u from "./BaseLayer.js";
3
- import { c, b as M } from "../matMul16--R5hOwDG.js";
3
+ import { c, b as M } from "../matMul16-fEAJ4smh.js";
4
4
  import { reshape16 as o } from "../ops/reshape16.js";
5
- import { v as d } from "../variable-Bhn5bHYv.js";
6
- import { r as h, d as b } from "../dropout-C1pM3f11.js";
5
+ import { v as d } from "../variable-DzfrwYuP.js";
6
+ import { r as h, d as b } from "../dropout-B1x1kYMa.js";
7
7
  class O extends u {
8
8
  index;
9
9
  hiddenUnits;
@@ -1,9 +1,9 @@
1
- import { t as c, I as u, b as i } from "../index-ZyQhjEPo.js";
1
+ import { t as c, I as u, b as i } from "../index-D6Q1lPZO.js";
2
2
  import f from "./BaseLayer.js";
3
- import { E as g, D as h } from "../random_width-DY6Kk2Dl.js";
4
- import { r as b } from "../exports_initializers-xuidcwI4.js";
5
- import { m as l } from "../mod-Gt1rMB4n.js";
6
- import { r as w } from "../range-BMS52eQi.js";
3
+ import { E as g, D as h } from "../random_width-BVV9HveY.js";
4
+ import { r as b } from "../exports_initializers-CZSUJoVE.js";
5
+ import { m as l } from "../mod-DESSvHIU.js";
6
+ import { r as w } from "../range-ZZZD60Fx.js";
7
7
  function E(t) {
8
8
  return new h(t);
9
9
  }
@@ -1,8 +1,8 @@
1
- import { t as s } from "../index-ZyQhjEPo.js";
1
+ import { t as s } from "../index-D6Q1lPZO.js";
2
2
  import e from "./BaseLayer.js";
3
3
  import { normRMS as a } from "../ops/normRMS.js";
4
- import { v as i } from "../variable-Bhn5bHYv.js";
5
- import { o as m } from "../ones-CAMiP4I2.js";
4
+ import { v as i } from "../variable-DzfrwYuP.js";
5
+ import { o as m } from "../ones-jU9jlQvM.js";
6
6
  class l extends e {
7
7
  GAMMA;
8
8
  constructor(r, t = "", o) {
@@ -1,7 +1,7 @@
1
- import { b as n, p as a, t as p, k as r } from "../index-ZyQhjEPo.js";
2
- import { r as c } from "../reciprocal-CTmshQ9J.js";
3
- import { c as l, s as f } from "../sin-BGfy2HZo.js";
4
- import { r as h } from "../range-BMS52eQi.js";
1
+ import { b as n, p as a, t as p, k as r } from "../index-D6Q1lPZO.js";
2
+ import { r as c } from "../reciprocal-CrYlsAGD.js";
3
+ import { c as l, s as f } from "../sin-Djs4aQiu.js";
4
+ import { r as h } from "../range-ZZZD60Fx.js";
5
5
  class g {
6
6
  constructor(s) {
7
7
  this.config = s;
@@ -1,13 +1,13 @@
1
- import "../random_width-DY6Kk2Dl.js";
2
- import "../index-ZyQhjEPo.js";
3
- import { r as s } from "../exports_initializers-xuidcwI4.js";
1
+ import "../random_width-BVV9HveY.js";
2
+ import "../index-D6Q1lPZO.js";
3
+ import { r as s } from "../exports_initializers-CZSUJoVE.js";
4
4
  import a from "./BaseLayer.js";
5
5
  import { dot16 as o } from "../ops/dot16.js";
6
6
  import { isPackedTensor as r } from "../utilities/packed.js";
7
- import { p as m } from "../pack16-CFUqumar.js";
7
+ import { p as m } from "../pack16-CmVZs6af.js";
8
8
  import { transpose16 as d } from "../ops/transpose16.js";
9
- import { v as p } from "../variable-Bhn5bHYv.js";
10
- import { g as h } from "../gather-DykLGqmW.js";
9
+ import { v as p } from "../variable-DzfrwYuP.js";
10
+ import { g as h } from "../gather-CH9sdacz.js";
11
11
  class g extends a {
12
12
  vocabSize;
13
13
  embedDim;
@@ -2,7 +2,7 @@ import p from "./CausalSelfAttention.js";
2
2
  import m from "./MLP.js";
3
3
  import d from "./RMSNorm.js";
4
4
  import h from "./BaseLayer.js";
5
- import { k as n, t as u } from "../index-ZyQhjEPo.js";
5
+ import { k as n, t as u } from "../index-D6Q1lPZO.js";
6
6
  import { add16 as l } from "../ops/add16.js";
7
7
  class g extends h {
8
8
  ln1;
@@ -1,7 +1,7 @@
1
1
  import l from "../tokeniser/CharTokeniser.js";
2
2
  import c from "../tokeniser/bpe.js";
3
3
  import { load_safetensors as b } from "../utilities/safetensors.js";
4
- import { H as y } from "../index-ZyQhjEPo.js";
4
+ import { H as y } from "../index-D6Q1lPZO.js";
5
5
  import { dummyPassAsync as u } from "../utilities/dummy.js";
6
6
  import _ from "../models/factory.js";
7
7
  async function L(e, a, r, t) {