@genai-fi/nanogpt 0.10.3 → 0.11.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 (225) hide show
  1. package/dist/Generator.d.ts +10 -5
  2. package/dist/Generator.js +1789 -1765
  3. package/dist/{RealDiv-KAPDe8zB.js → RealDiv-Ds-jvL09.js} +22 -22
  4. package/dist/{Reshape-BYkmUnAv.js → Reshape-Cd6e-Otn.js} +1 -1
  5. package/dist/{Reshape-Zt6eb7yh.js → Reshape-Ct266DEk.js} +9 -9
  6. package/dist/TeachableLLM.d.ts +4 -3
  7. package/dist/TeachableLLM.js +14 -14
  8. package/dist/Trainer.d.ts +2 -2
  9. package/dist/Trainer.js +6 -6
  10. package/dist/{axis_util-BaG7mf5A.js → axis_util-DofAuy0p.js} +3 -3
  11. package/dist/backend.js +2 -2
  12. package/dist/{backend_util-RCe-rHaj.js → backend_util-C7NWHpv7.js} +7 -7
  13. package/dist/{backend_webgpu-DE3ACOLx.js → backend_webgpu-B0Vls736.js} +10 -10
  14. package/dist/{broadcast_to-B3eYlZm7.js → broadcast_to-DDaNMbX7.js} +2 -2
  15. package/dist/checks/appendCache.js +2 -2
  16. package/dist/checks/attentionMask.js +3 -3
  17. package/dist/checks/gelu.js +2 -2
  18. package/dist/checks/matMulGelu.js +2 -2
  19. package/dist/checks/normRMS.js +4 -4
  20. package/dist/checks/normRMSGrad.js +3 -3
  21. package/dist/checks/packUnpack.js +2 -2
  22. package/dist/checks/qkv.js +4 -4
  23. package/dist/checks/rope.js +2 -2
  24. package/dist/{clip_by_value-BnO7-a88.js → clip_by_value-Dn5tzexi.js} +4 -4
  25. package/dist/complex-DClmWqJt.js +11 -0
  26. package/dist/{concat-BV8bt5H-.js → concat-C6X3AAlQ.js} +1 -1
  27. package/dist/{concat_util-DpW8mL_l.js → concat_util-CHsJFZJJ.js} +1 -1
  28. package/dist/{dataset-BcwmTGYc.js → dataset-DcjWqUVQ.js} +7 -7
  29. package/dist/{dropout-BcvN9JYi.js → dropout-OxuaJz6z.js} +11 -11
  30. package/dist/{expand_dims-DT4tEPwA.js → expand_dims-BzfJK2uc.js} +3 -3
  31. package/dist/{exports_initializers-Hta_rEnm.js → exports_initializers-eS9QJ6ut.js} +1 -1
  32. package/dist/{floor-D5QdR_le.js → floor-DIb-lN_u.js} +1 -1
  33. package/dist/gather-BcO5UQNJ.js +9 -0
  34. package/dist/{gelu-CjNPL4OH.js → gelu-DqTbCx5x.js} +1 -1
  35. package/dist/{gpgpu_math-DAOmgtXR.js → gpgpu_math-CJcbnKPC.js} +2 -2
  36. package/dist/{index-DOvlwCh-.js → index-D0RBWjq8.js} +52 -52
  37. package/dist/{index-BwexR4lA.js → index-Dj5TkmPY.js} +89 -89
  38. package/dist/{kernel_funcs_utils-CCzYdUZg.js → kernel_funcs_utils-CSaumNDs.js} +11 -11
  39. package/dist/layers/BaseLayer.js +2 -2
  40. package/dist/layers/CausalSelfAttention.js +6 -6
  41. package/dist/layers/MLP.js +4 -4
  42. package/dist/layers/PositionEmbedding.js +5 -5
  43. package/dist/layers/RMSNorm.js +3 -3
  44. package/dist/layers/RoPECache.js +4 -4
  45. package/dist/layers/TiedEmbedding.js +6 -6
  46. package/dist/layers/TransformerBlock.js +1 -1
  47. package/dist/loader/loadTransformers.js +1 -1
  48. package/dist/loader/oldZipLoad.js +17 -17
  49. package/dist/log_sum_exp-VLZgbFAH.js +39 -0
  50. package/dist/main.d.ts +1 -1
  51. package/dist/main.js +9 -9
  52. package/dist/{matMul16-BWRSOCWB.js → matMul16-cDxwemKj.js} +7 -7
  53. package/dist/{matMulGelu-CzfgT6Wq.js → matMulGelu-B2s_80-H.js} +18 -18
  54. package/dist/{mat_mul-SjpJRLyL.js → mat_mul-DxpNTCRz.js} +3 -3
  55. package/dist/{mod-AnXEvvpo.js → mod-PrOKlFxH.js} +1 -1
  56. package/dist/models/NanoGPTV1.js +2 -2
  57. package/dist/models/model.js +9 -9
  58. package/dist/{ones-D2rT0xk2.js → ones-BX_wEgzB.js} +3 -3
  59. package/dist/ops/adamAdjust.js +1 -1
  60. package/dist/ops/adamMoments.js +1 -1
  61. package/dist/ops/add16.js +1 -1
  62. package/dist/ops/appendCache.js +3 -3
  63. package/dist/ops/attentionMask.js +1 -1
  64. package/dist/ops/concat16.js +2 -2
  65. package/dist/ops/cpu/adamAdjust.js +6 -6
  66. package/dist/ops/cpu/adamMoments.js +2 -2
  67. package/dist/ops/cpu/appendCache.js +5 -5
  68. package/dist/ops/cpu/attentionMask.js +10 -10
  69. package/dist/ops/cpu/fusedSoftmax.js +2 -2
  70. package/dist/ops/cpu/gatherSub.js +6 -6
  71. package/dist/ops/cpu/gelu.js +9 -9
  72. package/dist/ops/cpu/matMul16.js +2 -2
  73. package/dist/ops/cpu/matMulGelu.js +3 -3
  74. package/dist/ops/cpu/matMulMul.js +1 -1
  75. package/dist/ops/cpu/mulDropout.js +1 -1
  76. package/dist/ops/cpu/normRMS.js +3 -3
  77. package/dist/ops/cpu/qkv.js +3 -3
  78. package/dist/ops/cpu/rope.js +9 -9
  79. package/dist/ops/cpu/scatterSub.js +11 -11
  80. package/dist/ops/dot16.js +2 -2
  81. package/dist/ops/gatherSub.js +1 -1
  82. package/dist/ops/gelu.js +2 -2
  83. package/dist/ops/grads/add16.js +4 -4
  84. package/dist/ops/grads/attentionMask.js +2 -2
  85. package/dist/ops/grads/gelu.js +2 -2
  86. package/dist/ops/grads/matMul16.js +3 -3
  87. package/dist/ops/grads/matMulGelu.js +3 -3
  88. package/dist/ops/grads/normRMS.js +7 -7
  89. package/dist/ops/grads/pack16.js +3 -3
  90. package/dist/ops/grads/qkv.js +6 -6
  91. package/dist/ops/grads/rope.js +2 -2
  92. package/dist/ops/grads/softmax16.js +1 -1
  93. package/dist/ops/grads/unpack16.js +2 -2
  94. package/dist/ops/matMul16.js +3 -3
  95. package/dist/ops/matMulGelu.js +2 -2
  96. package/dist/ops/matMulMul.js +1 -1
  97. package/dist/ops/mul16.js +1 -1
  98. package/dist/ops/mulDrop.js +1 -1
  99. package/dist/ops/normRMS.js +1 -1
  100. package/dist/ops/pack16.js +2 -2
  101. package/dist/ops/qkv.js +1 -1
  102. package/dist/ops/reshape16.js +6 -6
  103. package/dist/ops/rope.js +2 -2
  104. package/dist/ops/scatterSub.js +1 -1
  105. package/dist/ops/slice16.js +2 -2
  106. package/dist/ops/softmax16.js +1 -1
  107. package/dist/ops/sub16.js +1 -1
  108. package/dist/ops/sum16.js +2 -2
  109. package/dist/ops/transpose16.js +3 -3
  110. package/dist/ops/unpack16.js +2 -2
  111. package/dist/ops/webgl/adamAdjust.js +2 -2
  112. package/dist/ops/webgl/adamMoments.js +1 -1
  113. package/dist/ops/webgl/appendCache.js +1 -1
  114. package/dist/ops/webgl/attentionMask.js +4 -4
  115. package/dist/ops/webgl/fusedSoftmax.js +6 -6
  116. package/dist/ops/webgl/gatherSub.js +1 -1
  117. package/dist/ops/webgl/gelu.js +2 -2
  118. package/dist/ops/webgl/log.js +3 -3
  119. package/dist/ops/webgl/matMul16.js +11 -11
  120. package/dist/ops/webgl/matMulGelu.js +4 -4
  121. package/dist/ops/webgl/matMulMul.js +7 -7
  122. package/dist/ops/webgl/mulDropout.js +1 -1
  123. package/dist/ops/webgl/normRMS.js +7 -7
  124. package/dist/ops/webgl/qkv.js +1 -1
  125. package/dist/ops/webgl/rope.js +4 -4
  126. package/dist/ops/webgl/scatterSub.js +1 -1
  127. package/dist/ops/webgpu/adamAdjust.js +3 -3
  128. package/dist/ops/webgpu/adamMoments.js +3 -3
  129. package/dist/ops/webgpu/add16.js +1 -1
  130. package/dist/ops/webgpu/appendCache.js +3 -3
  131. package/dist/ops/webgpu/attentionMask.js +5 -5
  132. package/dist/ops/webgpu/attentionMask32_program.js +2 -2
  133. package/dist/ops/webgpu/concat16.js +5 -5
  134. package/dist/ops/webgpu/gatherSub.js +5 -5
  135. package/dist/ops/webgpu/gelu.js +3 -3
  136. package/dist/ops/webgpu/matMul16.js +18 -18
  137. package/dist/ops/webgpu/matMul16_program.js +2 -2
  138. package/dist/ops/webgpu/mul16.js +4 -4
  139. package/dist/ops/webgpu/normRMS.js +6 -6
  140. package/dist/ops/webgpu/normRMSGrad.js +4 -4
  141. package/dist/ops/webgpu/pack16.js +1 -1
  142. package/dist/ops/webgpu/pack16_program.js +2 -2
  143. package/dist/ops/webgpu/qkv.js +6 -6
  144. package/dist/ops/webgpu/rope.js +3 -3
  145. package/dist/ops/webgpu/scatterSub.js +3 -3
  146. package/dist/ops/webgpu/slice16.js +4 -4
  147. package/dist/ops/webgpu/softmax16.js +2 -2
  148. package/dist/ops/webgpu/softmax16_program.js +2 -2
  149. package/dist/ops/webgpu/softmax16_subgroup_program.js +2 -2
  150. package/dist/ops/webgpu/softmax16grad.js +1 -1
  151. package/dist/ops/webgpu/sub16.js +4 -4
  152. package/dist/ops/webgpu/sum16.js +6 -6
  153. package/dist/ops/webgpu/transpose16.js +2 -2
  154. package/dist/ops/webgpu/transpose16_program.js +2 -2
  155. package/dist/ops/webgpu/transpose16_shared_program.js +3 -3
  156. package/dist/ops/webgpu/unpack16.js +3 -3
  157. package/dist/ops/webgpu/utils/binary_op.js +3 -3
  158. package/dist/ops/webgpu/utils/reductions.js +4 -4
  159. package/dist/{ops-B5yanEdW.js → ops-FJapAPfm.js} +56 -56
  160. package/dist/{pack16-nQ6JaLo-.js → pack16-k4jq6aMX.js} +7 -7
  161. package/dist/patches/webgpu_backend.js +7 -7
  162. package/dist/patches/webgpu_base.js +1 -1
  163. package/dist/patches/webgpu_program.js +8 -8
  164. package/dist/{random_width-or-CEftb.js → random_width-UGQn4OWb.js} +33 -33
  165. package/dist/range-CuGvVN2c.js +10 -0
  166. package/dist/{relu-CP0ZcxWO.js → relu-Cf80uA2p.js} +1 -1
  167. package/dist/{reshape-ByE68wS9.js → reshape-CkjKPPqB.js} +1 -1
  168. package/dist/{resize_nearest_neighbor-B19mCEg2.js → resize_nearest_neighbor-DB8k9KN_.js} +43 -43
  169. package/dist/{rope-Ir4mTyD1.js → rope-BmZmp9uP.js} +1 -1
  170. package/dist/{scatter_nd_util-lvSiX8q4.js → scatter_nd_util-BY22Cc-C.js} +1 -1
  171. package/dist/{selu_util-kbhpTdYD.js → selu_util-BuLbmbrl.js} +5 -5
  172. package/dist/{shared-DT1TkE6w.js → shared-B7USJZgw.js} +1 -1
  173. package/dist/{shared-dntlHIDQ.js → shared-BQboIImQ.js} +86 -86
  174. package/dist/{slice-BfEGSH82.js → slice-Aqy7KbJh.js} +3 -3
  175. package/dist/{slice_util-uTKwiEpW.js → slice_util-D8CQRenR.js} +7 -7
  176. package/dist/{softmax-CA5jFsLR.js → softmax-faLoUZVT.js} +1 -1
  177. package/dist/{split-CVLc0w--.js → split-BNz5jcGc.js} +3 -3
  178. package/dist/{squeeze-C7Z2srUo.js → squeeze--YMgaAAf.js} +2 -2
  179. package/dist/{stack-Cf4n9h0N.js → stack-WJK22CFn.js} +1 -1
  180. package/dist/{step-CINUs5QB.js → step-dXR33iOg.js} +32 -32
  181. package/dist/sum-BdplSvq_.js +11 -0
  182. package/dist/tensor-BQqrDvpx.js +8 -0
  183. package/dist/tensor1d-LxP9asMm.js +11 -0
  184. package/dist/{tensor2d-Bs9wZRc7.js → tensor2d-BN1sSfQO.js} +3 -3
  185. package/dist/{tensor4d-BARPdTaS.js → tensor4d-DVwr7pLF.js} +1 -1
  186. package/dist/{tfjs_backend-y1cvNhLA.js → tfjs_backend-Vi4JfLzT.js} +28 -28
  187. package/dist/{tile-mbfagpsB.js → tile-CvN_LyVr.js} +4 -4
  188. package/dist/tokeniser/BaseTokeniser.d.ts +27 -0
  189. package/dist/tokeniser/BaseTokeniser.js +94 -0
  190. package/dist/tokeniser/CharTokeniser.d.ts +4 -3
  191. package/dist/tokeniser/CharTokeniser.js +46 -32
  192. package/dist/tokeniser/bpe.d.ts +4 -3
  193. package/dist/tokeniser/bpe.js +60 -45
  194. package/dist/tokeniser/type.d.ts +11 -0
  195. package/dist/training/Adam.js +2 -2
  196. package/dist/training/AdamExt.js +1 -1
  197. package/dist/training/DatasetBuilder.d.ts +2 -2
  198. package/dist/training/DatasetBuilder.js +32 -36
  199. package/dist/training/FullTrainer.js +1 -1
  200. package/dist/training/Trainer.d.ts +3 -3
  201. package/dist/training/Trainer.js +2 -2
  202. package/dist/training/sparseCrossEntropy.js +3 -3
  203. package/dist/{transpose-ClWiBS_b.js → transpose-JawVKyZy.js} +5 -5
  204. package/dist/{unsorted_segment_sum-BDDhB_E6.js → unsorted_segment_sum-LAbmE9G4.js} +78 -78
  205. package/dist/utilities/dummy.js +3 -3
  206. package/dist/utilities/multinomialCPU.js +2 -2
  207. package/dist/utilities/packed.js +1 -1
  208. package/dist/utilities/performance.js +1 -1
  209. package/dist/utilities/profile.js +1 -1
  210. package/dist/utilities/safetensors.js +2 -2
  211. package/dist/utilities/sentences.js +5 -5
  212. package/dist/utilities/weights.js +2 -2
  213. package/dist/{variable-WawDEaAb.js → variable-DQ9yYgEU.js} +1 -1
  214. package/dist/{webgpu_program-DuOXPQol.js → webgpu_program-CAE4RICo.js} +3 -3
  215. package/dist/{webgpu_util-RxEF33Rj.js → webgpu_util-BdovYhXr.js} +1 -1
  216. package/dist/{zeros-KnWaWf-X.js → zeros-DeiE2zTa.js} +2 -2
  217. package/dist/{zeros_like-DvE73F4e.js → zeros_like-BAz3iKru.js} +77 -77
  218. package/package.json +1 -1
  219. package/dist/complex-DjxcVmoX.js +0 -11
  220. package/dist/gather-D3JcZUaI.js +0 -9
  221. package/dist/log_sum_exp-ngO0-4pK.js +0 -39
  222. package/dist/range-BklejeeW.js +0 -10
  223. package/dist/sum-DWAtNGez.js +0 -11
  224. package/dist/tensor-DJoc7gJU.js +0 -8
  225. package/dist/tensor1d-D11P_7Dp.js +0 -11
@@ -1,10 +1,10 @@
1
- import { aG as T, j as E, af as O, h as V, aS as B, Y as F, am as j, aT as G } from "./index-DOvlwCh-.js";
2
- import { r as $ } from "./Reshape-Zt6eb7yh.js";
3
- import { a as A, b as k, d as C, c as N, e as R } from "./axis_util-BaG7mf5A.js";
4
- import { t as K, m as U } from "./shared-DT1TkE6w.js";
5
- import { c as W } from "./backend_util-RCe-rHaj.js";
6
- import { f as y } from "./gpgpu_math-DAOmgtXR.js";
7
- import { g as _, b as L } from "./kernel_funcs_utils-CCzYdUZg.js";
1
+ import { aG as T, ab as E, af as O, V, aS as B, Q as F, am as G, aT as K } from "./index-D0RBWjq8.js";
2
+ import { r as $ } from "./Reshape-Ct266DEk.js";
3
+ import { a as A, b as k, d as C, c as N, e as R } from "./axis_util-DofAuy0p.js";
4
+ import { t as U, m as W } from "./shared-B7USJZgw.js";
5
+ import { c as _ } from "./backend_util-C7NWHpv7.js";
6
+ import { f as y } from "./gpgpu_math-CJcbnKPC.js";
7
+ import { g as j, b as L } from "./kernel_funcs_utils-CSaumNDs.js";
8
8
  class w {
9
9
  constructor(s, e) {
10
10
  this.variableNames = ["x"];
@@ -181,10 +181,10 @@ class X {
181
181
  `;
182
182
  }
183
183
  }
184
- function Y(a) {
184
+ function q(a) {
185
185
  const s = [];
186
186
  for (; s.length === 0 || s[s.length - 1].outSize !== 1; ) {
187
- const e = s.length ? s[s.length - 1].outSize : a[1], t = W(e);
187
+ const e = s.length ? s[s.length - 1].outSize : a[1], t = _(e);
188
188
  s.push({
189
189
  inSize: e,
190
190
  windowSize: t,
@@ -194,7 +194,7 @@ function Y(a) {
194
194
  return s;
195
195
  }
196
196
  function P(a, s, e, t) {
197
- const n = Y(a.shape);
197
+ const n = q(a.shape);
198
198
  let l = a;
199
199
  for (let r = 0; r < n.length; r++) {
200
200
  const { inSize: i, windowSize: c, outSize: o } = n[r];
@@ -203,14 +203,14 @@ function P(a, s, e, t) {
203
203
  }
204
204
  return l;
205
205
  }
206
- class q {
206
+ class Q {
207
207
  constructor(s, e) {
208
208
  this.variableNames = ["A"];
209
209
  const t = new Array(s.length);
210
210
  for (let r = 0; r < t.length; r++)
211
211
  t[r] = s[e[r]];
212
212
  this.outputShape = t, this.rank = t.length;
213
- const n = y(this.rank), l = H(e);
213
+ const n = y(this.rank), l = Y(e);
214
214
  this.userCode = `
215
215
  void main() {
216
216
  ${n} resRC = getOutputCoords();
@@ -219,7 +219,7 @@ class q {
219
219
  `;
220
220
  }
221
221
  }
222
- function H(a) {
222
+ function Y(a) {
223
223
  const s = a.length;
224
224
  if (s > 6)
225
225
  throw Error(`Transpose for rank ${s} is not yet supported`);
@@ -228,7 +228,7 @@ function H(a) {
228
228
  t[a[n]] = e[n];
229
229
  return t.join();
230
230
  }
231
- class J {
231
+ class H {
232
232
  constructor(s, e) {
233
233
  this.variableNames = ["A"], this.packedInputs = !0, this.packedOutput = !0;
234
234
  const t = new Array(s.length);
@@ -236,7 +236,7 @@ class J {
236
236
  t[u] = s[e[u]];
237
237
  if (this.outputShape = t, this.rank = t.length, this.rank > 6)
238
238
  throw Error(`Packed transpose for rank ${this.rank} is not yet supported.`);
239
- const n = y(this.rank), l = _("rc", this.rank), r = new Array(this.rank);
239
+ const n = y(this.rank), l = j("rc", this.rank), r = new Array(this.rank);
240
240
  for (let u = 0; u < e.length; u++)
241
241
  r[e[u]] = l[u];
242
242
  const i = `vec2(${r.slice(-2).join()})`, c = `++${l[this.rank - 1]} < ${t[this.rank - 1]}`, o = `getChannel(getA(${r.join()}), ${i})`;
@@ -261,10 +261,10 @@ class J {
261
261
  }
262
262
  }
263
263
  function D(a, s, e) {
264
- const t = E().getBool("WEBGL_PACK_ARRAY_OPERATIONS") ? new J(a.shape, s) : new q(a.shape, s);
264
+ const t = E().getBool("WEBGL_PACK_ARRAY_OPERATIONS") ? new H(a.shape, s) : new Q(a.shape, s);
265
265
  return e.runWebGLProgram(t, [a], a.dtype);
266
266
  }
267
- function Q(a, s, e, t) {
267
+ function J(a, s, e, t) {
268
268
  const n = s, l = a.shape.length, r = O(n, a.shape);
269
269
  let i = r;
270
270
  const c = A(i, l), o = c != null;
@@ -278,7 +278,7 @@ function Q(a, s, e, t) {
278
278
  }
279
279
  function Z(a) {
280
280
  const { inputs: s, backend: e, attrs: t } = a, { x: n } = s, { axis: l, keepDims: r } = t;
281
- return Q(n, l, r, e);
281
+ return J(n, l, r, e);
282
282
  }
283
283
  const pe = {
284
284
  kernelName: F,
@@ -299,7 +299,7 @@ function te(a) {
299
299
  const I = e.texData.get(d.dataId).values, m = new Array(i);
300
300
  for (let v = 0; v < m.length; v++)
301
301
  m[v] = n.shape[u[v]];
302
- const z = K(I, n.shape, n.dtype, u, m);
302
+ const z = U(I, n.shape, n.dtype, u, m);
303
303
  d = e.makeTensorInfo(m, n.dtype);
304
304
  const M = e.texData.get(d.dataId);
305
305
  M.values = z;
@@ -313,7 +313,7 @@ function te(a) {
313
313
  r && (g = R(f, c));
314
314
  let x;
315
315
  if (h) {
316
- const I = e.texData.get(d.dataId).values, m = U(I, V(S), g, n.dtype);
316
+ const I = e.texData.get(d.dataId).values, m = W(I, V(S), g, n.dtype);
317
317
  x = e.makeTensorInfo(g, n.dtype);
318
318
  const z = e.texData.get(x.dataId);
319
319
  z.values = m;
@@ -322,7 +322,7 @@ function te(a) {
322
322
  return p && e.disposeIntermediateTensorInfo(d), x;
323
323
  }
324
324
  const he = {
325
- kernelName: j,
325
+ kernelName: G,
326
326
  backendName: "webgl",
327
327
  kernelFunc: te
328
328
  };
@@ -349,7 +349,7 @@ return a / b;`, se = `
349
349
 
350
350
  return result;
351
351
  `, ne = L({ opSnippet: ae, packedOpSnippet: se, checkOutOfBounds: !0 }), fe = {
352
- kernelName: G,
352
+ kernelName: K,
353
353
  backendName: "webgl",
354
354
  kernelFunc: ne
355
355
  };
@@ -1,4 +1,4 @@
1
- import { h, ah as d, l as c, R as m } from "./index-DOvlwCh-.js";
1
+ import { V as h, ah as d, y as c, R as m } from "./index-D0RBWjq8.js";
2
2
  function i(n) {
3
3
  const { inputs: p, attrs: o } = n, { x: e } = p, { shape: r } = o, a = h(e.shape), s = d(r, a), t = h(s);
4
4
  return c(a === t, () => `The new shape (${s}) has ${t} elements and the old shape (${e.shape}) has ${a} elements. The new shape and old shape must have the same number of elements.`), n.backend.incRef(e.dataId), { dataId: e.dataId, shape: s, dtype: e.dtype };
@@ -1,5 +1,5 @@
1
- import { R as C, h as c, ah as R, l as f } from "./index-DOvlwCh-.js";
2
- import { u as g, g as I, a as x, b as F, c as $, d as u, e as l, i as m } from "./gpgpu_math-DAOmgtXR.js";
1
+ import { R as C, V as c, ah as R, y as f } from "./index-D0RBWjq8.js";
2
+ import { u as g, g as I, a as x, b as F, c as $, d as u, e as m, i as l } from "./gpgpu_math-CJcbnKPC.js";
3
3
  class S {
4
4
  constructor(t, i) {
5
5
  this.variableNames = ["A"], this.packedInputs = !0, this.packedOutput = !0, this.customUniforms = [{ name: "inputShape", type: "ivec3" }], this.outputShape = t, this.enableShapeUniforms = g(this.outputShape.length);
@@ -47,33 +47,33 @@ function v(s, t) {
47
47
  }
48
48
  `;
49
49
  }
50
- function b(s, t, i) {
50
+ function y(s, t, i) {
51
51
  const a = [
52
52
  u(s.shape),
53
- ...l(s.shape)
53
+ ...m(s.shape)
54
54
  ], e = {
55
55
  dtype: s.dtype,
56
56
  shape: a,
57
57
  dataId: s.dataId
58
58
  }, o = [
59
59
  u(t),
60
- ...l(t)
60
+ ...m(t)
61
61
  ], r = new S(o, a), p = !0, n = [a], h = i.runWebGLProgram(r, [e], s.dtype, n, p);
62
62
  return { dataId: h.dataId, shape: t, dtype: h.dtype };
63
63
  }
64
- function y(s) {
64
+ function b(s) {
65
65
  const { inputs: t, backend: i, attrs: a } = s, { x: e } = t, { shape: o } = a, r = i, p = c(e.shape), n = R(o, p), h = c(n);
66
66
  f(p === h, () => `The new shape (${n}) has ${h} elements and the old shape (${e.shape}) has ${p} elements. The new shape and old shape must have the same number of elements.`);
67
67
  const d = r.texData.get(e.dataId);
68
- return d.isPacked && !m(e.shape, n) && !(d.texture !== null && m(d.shape, n)) ? b(e, n, r) : (r.incRef(e.dataId), { dataId: e.dataId, shape: n, dtype: e.dtype });
68
+ return d.isPacked && !l(e.shape, n) && !(d.texture !== null && l(d.shape, n)) ? y(e, n, r) : (r.incRef(e.dataId), { dataId: e.dataId, shape: n, dtype: e.dtype });
69
69
  }
70
70
  const U = {
71
71
  kernelName: C,
72
72
  backendName: "webgl",
73
- kernelFunc: y
73
+ kernelFunc: b
74
74
  };
75
75
  export {
76
76
  S as R,
77
77
  U as a,
78
- y as r
78
+ b as r
79
79
  };
@@ -1,5 +1,5 @@
1
1
  import { GPTConfig } from './models/config';
2
- import { ITokeniser } from './tokeniser/type';
2
+ import { Conversation, ITokeniser } from './tokeniser/type';
3
3
  import { SaveOptions } from './loader/save';
4
4
  import { default as Generator, IGenerateOptions } from './Generator';
5
5
  import { default as Trainer, ITrainerOptions } from './Trainer';
@@ -41,10 +41,11 @@ export default class TeachableLLM {
41
41
  set enableProfiler(value: boolean);
42
42
  getNumParams(): number;
43
43
  trainer(): Trainer;
44
- train(text: string[], options?: ITrainerOptions): Promise<void>;
44
+ train(text: Conversation[][], options?: ITrainerOptions): Promise<void>;
45
45
  trainTokeniser(text: string[]): Promise<number>;
46
46
  generator(): Generator;
47
- generateText(prompt?: string, options?: IGenerateOptions): Promise<string>;
47
+ generateText(prompt: Conversation[], options?: IGenerateOptions): Promise<Conversation[]>;
48
+ generateText(options?: IGenerateOptions): Promise<Conversation[]>;
48
49
  dispose(): void;
49
50
  on(event: 'status', listener: (status: TeachableLLMStatus) => void): void;
50
51
  on(event: 'error', listener: (error: Error) => void): void;
@@ -2,27 +2,27 @@ import { defaultConfig as d } from "./models/config.js";
2
2
  import { saveModel as l } from "./loader/save.js";
3
3
  import { loadModel as _ } from "./loader/load.js";
4
4
  import u from "./Generator.js";
5
- import p from "./Trainer.js";
6
- import { E as f } from "./index-DvYrXKkX.js";
5
+ import f from "./Trainer.js";
6
+ import { E as p } from "./index-DvYrXKkX.js";
7
7
  import { dummyPassTrainAsync as m } from "./utilities/dummy.js";
8
- import "./index-DOvlwCh-.js";
9
- import "./random_width-or-CEftb.js";
10
- import "./zeros_like-DvE73F4e.js";
8
+ import "./index-D0RBWjq8.js";
9
+ import "./random_width-UGQn4OWb.js";
10
+ import "./zeros_like-BAz3iKru.js";
11
11
  import "./index-Cp39cXWe.js";
12
- import "./dataset-BcwmTGYc.js";
12
+ import "./dataset-DcjWqUVQ.js";
13
13
  import "./ops/cpu/attentionMask.js";
14
14
  import "./ops/webgl/attentionMask.js";
15
15
  import "./ops/grads/attentionMask.js";
16
16
  import "./ops/cpu/rope.js";
17
17
  import "./ops/webgl/rope.js";
18
- import "./rope-Ir4mTyD1.js";
18
+ import "./rope-BmZmp9uP.js";
19
19
  import "./ops/cpu/appendCache.js";
20
20
  import "./ops/webgl/appendCache.js";
21
21
  import "./ops/grads/softmax16.js";
22
- import "./matMul16-BWRSOCWB.js";
22
+ import "./matMul16-cDxwemKj.js";
23
23
  import "./ops/webgl/matMul16.js";
24
24
  import "./ops/cpu/matMul16.js";
25
- import "./pack16-nQ6JaLo-.js";
25
+ import "./pack16-k4jq6aMX.js";
26
26
  import "./ops/transpose16.js";
27
27
  import "./ops/reshape16.js";
28
28
  import "./ops/cpu/qkv.js";
@@ -41,11 +41,11 @@ import g from "./tokeniser/bpe.js";
41
41
  import "./papaparse.min-C0cScC2i.js";
42
42
  import "./jszip.min-Bz5-11Bk.js";
43
43
  import "./ops/cpu/matMulGelu.js";
44
- import "./matMulGelu-CzfgT6Wq.js";
44
+ import "./matMulGelu-B2s_80-H.js";
45
45
  import "./ops/grads/matMulGelu.js";
46
46
  import "./ops/cpu/gelu.js";
47
47
  import "./ops/webgl/gelu.js";
48
- import "./gelu-CjNPL4OH.js";
48
+ import "./gelu-DqTbCx5x.js";
49
49
  import "./ops/webgl/log.js";
50
50
  import "./ops/cpu/adamMoments.js";
51
51
  import "./ops/webgl/adamMoments.js";
@@ -56,7 +56,7 @@ import "./checks/normRMSGrad.js";
56
56
  import k from "./utilities/profile.js";
57
57
  import w from "./models/factory.js";
58
58
  class a {
59
- ee = new f();
59
+ ee = new p();
60
60
  _config;
61
61
  _model;
62
62
  _tokeniser;
@@ -155,7 +155,7 @@ class a {
155
155
  trainer() {
156
156
  if (!this._model || !this._tokeniser)
157
157
  throw new Error("model_or_tokeniser_not_initialized.");
158
- const t = new p(this._model, this._tokeniser);
158
+ const t = new f(this._model, this._tokeniser);
159
159
  return t.on("start", () => this.setStatus("training")), t.on("stop", () => this.setStatus("ready")), t.on("log", async (e, r) => {
160
160
  const o = this.ee.listeners("trainStep");
161
161
  for (const s of o)
@@ -183,7 +183,7 @@ class a {
183
183
  }), t;
184
184
  }
185
185
  generateText(t, e) {
186
- return this.generator().generate(t, e);
186
+ return Array.isArray(t) ? this.generator().generate(t, e) : this.generator().generate([], e);
187
187
  }
188
188
  dispose() {
189
189
  this._model?.dispose();
package/dist/Trainer.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ITokeniser } from './tokeniser/type';
1
+ import { Conversation, ITokeniser } from './tokeniser/type';
2
2
  import { default as EE } from 'eventemitter3';
3
3
  import { TrainingLogEntry, TrainingProgress } from './training/Trainer';
4
4
  import { default as Model, ModelForwardAttributes } from './models/model';
@@ -30,7 +30,7 @@ export default class Trainer extends EE<'start' | 'stop' | 'log'> {
30
30
  constructor(model: Model<ModelForwardAttributes>, tokeniser: ITokeniser);
31
31
  stop(): void;
32
32
  reset(): void;
33
- prepare(text: string[], options?: ITrainerOptions): Promise<void>;
33
+ prepare(text: Conversation[][], options?: ITrainerOptions): Promise<void>;
34
34
  train(options?: ITrainerOptions): Promise<void>;
35
35
  step(options?: ITrainerOptions): Promise<void>;
36
36
  getLog(): TrainingLogEntry[];
package/dist/Trainer.js CHANGED
@@ -1,6 +1,6 @@
1
- import { E as l } from "./index-DvYrXKkX.js";
2
- import h from "./training/FullTrainer.js";
3
- class m extends l {
1
+ import { E as o } from "./index-DvYrXKkX.js";
2
+ import d from "./training/FullTrainer.js";
3
+ class g extends o {
4
4
  trainer;
5
5
  hasTrained = !1;
6
6
  trainDataset;
@@ -9,7 +9,7 @@ class m extends l {
9
9
  log = [];
10
10
  progress = null;
11
11
  constructor(t, e) {
12
- super(), this.trainer = new h(t, e, 1e-3);
12
+ super(), this.trainer = new d(t, e, 1e-3);
13
13
  }
14
14
  stop() {
15
15
  this.trainer.stop();
@@ -22,7 +22,7 @@ class m extends l {
22
22
  t,
23
23
  e?.batchSize || 32,
24
24
  e?.validationSplit || 0.1
25
- ), i = t.reduce((r, n) => r + n.length, 0) * (1 - (e?.validationSplit || 0));
25
+ ), i = t.reduce((r, n) => r + n.reduce((l, h) => l + h.content.length, 0), 0) * (1 - (e?.validationSplit || 0));
26
26
  this.trainDataset = a, this.validationDataset = s, this.totalSamples = i;
27
27
  }
28
28
  async train(t) {
@@ -91,5 +91,5 @@ class m extends l {
91
91
  }
92
92
  }
93
93
  export {
94
- m as default
94
+ g as default
95
95
  };
@@ -1,4 +1,4 @@
1
- import { l as c } from "./index-DOvlwCh-.js";
1
+ import { y as c } from "./index-D0RBWjq8.js";
2
2
  function i(e, n) {
3
3
  for (let t = 0; t < e.length; ++t)
4
4
  if (e[e.length - t - 1] !== n - 1 - t)
@@ -12,7 +12,7 @@ function a(e, n, t) {
12
12
  t.indexOf(u) === -1 ? s.push(e[o++]) : s.push(n[f++]);
13
13
  return s;
14
14
  }
15
- function p(e, n) {
15
+ function l(e, n) {
16
16
  const t = [], r = e.length;
17
17
  for (let o = 0; o < r; o++)
18
18
  n.indexOf(o) === -1 && t.push(e[o]);
@@ -46,7 +46,7 @@ function x(e, n) {
46
46
  export {
47
47
  d as a,
48
48
  x as b,
49
- p as c,
49
+ l as c,
50
50
  m as d,
51
51
  h as e,
52
52
  i as f,
package/dist/backend.js CHANGED
@@ -1,9 +1,9 @@
1
- import { g as o, s as e, r as s } from "./index-DOvlwCh-.js";
1
+ import { g as o, s as e, r as s } from "./index-D0RBWjq8.js";
2
2
  async function c(t, a) {
3
3
  if (o() !== t) {
4
4
  if (t === "webgpu") {
5
5
  const { registerWebGPUBackend: i } = await import("./patches/webgpu_base.js");
6
- i(a), await import("./index-BwexR4lA.js"), await import("./ops/webgpu/index.js");
6
+ i(a), await import("./index-Dj5TkmPY.js"), await import("./ops/webgpu/index.js");
7
7
  }
8
8
  await e(t), await s(), console.log(`Backend set to ${t}`);
9
9
  }
@@ -1,10 +1,10 @@
1
- import { h as m, ad as w, aU as I, l as d, ax as A, aB as _, a3 as y, o as M, a4 as T, aV as b, ak as D, aW as x } from "./index-DOvlwCh-.js";
2
- import { d as L, f as W, h as v, c as F, e as N, a as C, b as P, g as z } from "./axis_util-BaG7mf5A.js";
3
- import { a as B, c as U } from "./concat_util-DpW8mL_l.js";
4
- import { c as V, b as G, d as H, f as j, g as q, h as Z, i as k, j as J, k as K, m as X, t as Y } from "./step-CINUs5QB.js";
5
- import { S as Q, a as ee, b as te, g as se, c as ne, s as re } from "./selu_util-kbhpTdYD.js";
6
- import { s as oe } from "./slice_util-uTKwiEpW.js";
7
- import { c as ae, v as ie, a as ue } from "./scatter_nd_util-lvSiX8q4.js";
1
+ import { V as m, a9 as w, aU as I, y as d, ax as A, aB as _, $ as y, ad as M, a0 as T, aV as b, ak as D, aW as x } from "./index-D0RBWjq8.js";
2
+ import { d as L, f as W, h as v, c as F, e as N, a as C, b as P, g as z } from "./axis_util-DofAuy0p.js";
3
+ import { a as B, c as U } from "./concat_util-CHsJFZJJ.js";
4
+ import { c as V, b as G, d as H, f as j, g as q, h as Z, i as k, j as J, k as K, m as X, t as Y } from "./step-dXR33iOg.js";
5
+ import { S as Q, a as ee, b as te, g as se, c as ne, s as re } from "./selu_util-BuLbmbrl.js";
6
+ import { s as oe } from "./slice_util-D8CQRenR.js";
7
+ import { c as ae, v as ie, a as ue } from "./scatter_nd_util-BY22Cc-C.js";
8
8
  import { a as le, c as pe, b as ce, e as he, d as fe, g as ge, m as de, s as me } from "./complex_util-Yc1A_gV1.js";
9
9
  function Ee(e, t) {
10
10
  const r = e.shape.length, s = t.shape.length;
@@ -1,6 +1,6 @@
1
- import { j as g, au as $, av as K, e as D, l as _, aw as O, h as x, ax as Z, at as W, ay as F, az as j, aA as X, aB as J, i as ee, ad as k } from "./index-DOvlwCh-.js";
2
- import { m as te, f as se, P as re } from "./webgpu_program-DuOXPQol.js";
3
- import { i as ne, G as q } from "./webgpu_util-RxEF33Rj.js";
1
+ import { ab as g, au as $, av as K, e as D, y as _, aw as O, V as x, ax as Z, at as W, ay as F, az as j, aA as X, aB as J, ae as ee, a9 as k } from "./index-D0RBWjq8.js";
2
+ import { m as te, f as se, P as re } from "./webgpu_program-CAE4RICo.js";
3
+ import { i as ne, G as q } from "./webgpu_util-BdovYhXr.js";
4
4
  import { m as N } from "./complex_util-Yc1A_gV1.js";
5
5
  const d = g();
6
6
  d.registerFlag("WEBGPU_DEFERRED_SUBMIT_BATCH_SIZE", () => 15);
@@ -264,7 +264,7 @@ class R extends $ {
264
264
  alphaMode: r[B]
265
265
  }), y.getCurrentTexture();
266
266
  }).map((E, B) => {
267
- const y = f * 4, b = (P, S, v) => {
267
+ const y = f * 4, G = (P, S, v) => {
268
268
  this.ensureCommandEncoderReady(), this.commandEncoder.copyBufferToTexture({
269
269
  buffer: a,
270
270
  bytesPerRow: y,
@@ -279,20 +279,20 @@ class R extends $ {
279
279
  willReadFrequently: !0
280
280
  });
281
281
  I.clearRect(0, 0, P, S), I.drawImage(h[B], 0, 0);
282
- const G = I.getImageData(0, 0, P, S).data, H = r[B], M = new Uint8ClampedArray(o, v, P * S * 4);
282
+ const b = I.getImageData(0, 0, P, S).data, H = r[B], M = new Uint8ClampedArray(o, v, P * S * 4);
283
283
  for (let p = 0; p < M.length; p += 4)
284
284
  if (H === "premultiplied")
285
- M[p + 3] = G[p + 3];
285
+ M[p + 3] = b[p + 3];
286
286
  else {
287
- const V = G[p];
288
- M[p] = G[p + 2], M[p + 1] = G[p + 1], M[p + 2] = V;
287
+ const V = b[p];
288
+ M[p] = b[p + 2], M[p + 1] = b[p + 1], M[p + 2] = V;
289
289
  }
290
290
  }, Y = Math.floor(u / (f * c));
291
291
  let T = f, U = c, C = 0;
292
292
  for (let P = 0; P < Y; P++)
293
- b(T, U, C), C += f * c * 4;
293
+ G(T, U, C), C += f * c * 4;
294
294
  const A = u % (f * c);
295
- U = Math.floor(A / f), U > 0 && (b(T, U, C), C += U * (f * 4)), T = A % f, T > 0 && b(T, 1, C);
295
+ U = Math.floor(A / f), U > 0 && (G(T, U, C), C += U * (f * 4)), T = A % f, T > 0 && G(T, 1, C);
296
296
  });
297
297
  const w = O(o, t.dtype);
298
298
  return this.convertAndCacheOnCPU(e, w), w;
@@ -1,5 +1,5 @@
1
- import { A as h, B as f, C as p, D as g, E as u, T } from "./index-DOvlwCh-.js";
2
- import { r as b } from "./reshape-ByE68wS9.js";
1
+ import { q as h, u as f, w as p, x as g, E as u, T } from "./index-D0RBWjq8.js";
2
+ import { r as b } from "./reshape-CkjKPPqB.js";
3
3
  function m(e, r) {
4
4
  let n = f(e, "broadcastTo", "x");
5
5
  const a = n.shape;
@@ -1,5 +1,5 @@
1
- import { s, e as a } from "../index-DOvlwCh-.js";
2
- import { t } from "../tensor4d-BARPdTaS.js";
1
+ import { s, e as a } from "../index-D0RBWjq8.js";
2
+ import { t } from "../tensor4d-DVwr7pLF.js";
3
3
  async function u(e) {
4
4
  await s(e);
5
5
  const n = t(
@@ -1,6 +1,6 @@
1
- import { s as i, e } from "../index-DOvlwCh-.js";
2
- import { t } from "../tensor4d-BARPdTaS.js";
3
- import { t as a } from "../tensor2d-Bs9wZRc7.js";
1
+ import { s as i, e } from "../index-D0RBWjq8.js";
2
+ import { t } from "../tensor4d-DVwr7pLF.js";
3
+ import { t as a } from "../tensor2d-BN1sSfQO.js";
4
4
  async function k(n) {
5
5
  await i(n);
6
6
  const s = t(
@@ -1,5 +1,5 @@
1
- import { s as e, e as o } from "../index-DOvlwCh-.js";
2
- import { t as s } from "../tensor2d-Bs9wZRc7.js";
1
+ import { s as e, e as o } from "../index-D0RBWjq8.js";
2
+ import { t as s } from "../tensor2d-BN1sSfQO.js";
3
3
  async function m(t) {
4
4
  await e(t);
5
5
  const r = s(
@@ -1,5 +1,5 @@
1
- import { s as o, e as s } from "../index-DOvlwCh-.js";
2
- import { t as e } from "../tensor2d-Bs9wZRc7.js";
1
+ import { s as o, e as s } from "../index-D0RBWjq8.js";
2
+ import { t as e } from "../tensor2d-BN1sSfQO.js";
3
3
  async function i(t) {
4
4
  await o(t);
5
5
  const r = e(
@@ -1,7 +1,7 @@
1
- import { s as u, a5 as A, e as y } from "../index-DOvlwCh-.js";
2
- import { a as h } from "../ops-B5yanEdW.js";
3
- import { t as p } from "../tensor1d-D11P_7Dp.js";
4
- import { t as r } from "../tensor-DJoc7gJU.js";
1
+ import { s as u, a1 as A, e as y } from "../index-D0RBWjq8.js";
2
+ import { a as h } from "../ops-FJapAPfm.js";
3
+ import { t as p } from "../tensor1d-LxP9asMm.js";
4
+ import { t as r } from "../tensor-BQqrDvpx.js";
5
5
  const w = Array.from({ length: 2048 * 192 }, () => Math.random()), x = Array.from({ length: 192 }, () => Math.random()), M = Array.from({ length: 2048 * 192 }, () => Math.random());
6
6
  async function k(t) {
7
7
  await u(t);
@@ -1,6 +1,6 @@
1
- import { s as c, e as d } from "../index-DOvlwCh-.js";
2
- import { t as f } from "../tensor1d-D11P_7Dp.js";
3
- import { t as r } from "../tensor-DJoc7gJU.js";
1
+ import { s as c, e as d } from "../index-D0RBWjq8.js";
2
+ import { t as f } from "../tensor1d-LxP9asMm.js";
3
+ import { t as r } from "../tensor-BQqrDvpx.js";
4
4
  const y = Array.from({ length: 2048 * 192 }, () => Math.random()), i = Array.from({ length: 192 }, () => Math.random()), l = Array.from({ length: 2048 * 192 }, () => Math.random());
5
5
  async function x(t) {
6
6
  await c(t);
@@ -1,5 +1,5 @@
1
- import { s as a, e } from "../index-DOvlwCh-.js";
2
- import { t as c } from "../tensor2d-Bs9wZRc7.js";
1
+ import { s as a, e } from "../index-D0RBWjq8.js";
2
+ import { t as c } from "../tensor2d-BN1sSfQO.js";
3
3
  async function i(n) {
4
4
  await a(n);
5
5
  const r = c(
@@ -1,5 +1,5 @@
1
- import { $ as i, a0 as u, a1 as c, s as l, e as h } from "../index-DOvlwCh-.js";
2
- import { t as f } from "../tensor2d-Bs9wZRc7.js";
1
+ import { X as i, Y as u, Z as c, s as l, e as h } from "../index-D0RBWjq8.js";
2
+ import { t as f } from "../tensor2d-BN1sSfQO.js";
3
3
  function m(t, e, n) {
4
4
  if (i(t), e != null && e.length !== 3)
5
5
  throw new Error("tensor3d() requires shape to have three numbers");
@@ -26,8 +26,8 @@ async function y(t) {
26
26
  [0.7, 0.8, 1.1, 1.2, 1.5, 1.6]
27
27
  ],
28
28
  [2, 6]
29
- ), r = h().runKernel("QKV", { x: e, kernel: n }, { heads: 1 }), a = await r[0].array(), o = await r[1].array(), s = await r[2].array();
30
- return [a, o, s];
29
+ ), r = h().runKernel("QKV", { x: e, kernel: n }, { heads: 1 }), o = await r[0].array(), a = await r[1].array(), s = await r[2].array();
30
+ return [o, a, s];
31
31
  }
32
32
  export {
33
33
  y as execute
@@ -1,6 +1,6 @@
1
1
  import t from "../layers/RoPECache.js";
2
- import { s as c, e as i } from "../index-DOvlwCh-.js";
3
- import { t as p } from "../tensor4d-BARPdTaS.js";
2
+ import { s as c, e as i } from "../index-D0RBWjq8.js";
3
+ import { t as p } from "../tensor4d-DVwr7pLF.js";
4
4
  async function y(a) {
5
5
  await c(a);
6
6
  const o = p(
@@ -1,8 +1,8 @@
1
- import { A as a, B as m, l as y, q as B, E as c, F as f } from "./index-DOvlwCh-.js";
1
+ import { q as a, u as y, y as m, i as u, E as c, C as f } from "./index-D0RBWjq8.js";
2
2
  function p(o, s, t) {
3
- const r = m(o, "x", "clipByValue");
4
- if (y(s <= t, () => `Error in clip: min (${s}) must be less than or equal to max (${t}).`), s === t)
5
- return B(r.shape, s, r.dtype);
3
+ const r = y(o, "x", "clipByValue");
4
+ if (m(s <= t, () => `Error in clip: min (${s}) must be less than or equal to max (${t}).`), s === t)
5
+ return u(r.shape, s, r.dtype);
6
6
  const n = { x: r }, e = { clipValueMin: s, clipValueMax: t };
7
7
  return c.runKernel(f, n, e);
8
8
  }
@@ -0,0 +1,11 @@
1
+ import { q as c, u as s, a7 as n, E as m, a8 as r } from "./index-D0RBWjq8.js";
2
+ function l(o, p) {
3
+ const a = s(o, "real", "complex"), e = s(p, "imag", "complex");
4
+ n(a.shape, e.shape, `real and imag shapes, ${a.shape} and ${e.shape}, must match in call to tf.complex().`);
5
+ const t = { real: a, imag: e };
6
+ return m.runKernel(r, t);
7
+ }
8
+ const i = /* @__PURE__ */ c({ complex_: l });
9
+ export {
10
+ i as c
11
+ };
@@ -1,4 +1,4 @@
1
- import { A as s, l as a, G as p, D as i, E as l, H as f } from "./index-DOvlwCh-.js";
1
+ import { q as s, y as a, z as p, x as i, E as l, A as f } from "./index-D0RBWjq8.js";
2
2
  function h(n, e = 0) {
3
3
  a(n.length >= 1, () => "Pass at least one tensor to concat");
4
4
  const t = p(n, "tensors", "concat", "string_or_numeric");
@@ -1,4 +1,4 @@
1
- import { l as s } from "./index-DOvlwCh-.js";
1
+ import { y as s } from "./index-D0RBWjq8.js";
2
2
  function h(n, o) {
3
3
  const t = n[0].length;
4
4
  n.forEach((a, c) => {
@@ -1,7 +1,7 @@
1
- import { aC as S, a8 as h, j as N, d as v, aD as o, aE as p, aF as g, l as k, t as y } from "./index-DOvlwCh-.js";
1
+ import { aC as S, a4 as h, ab as N, d as v, aD as o, aE as p, aF as g, y as k, t as y } from "./index-D0RBWjq8.js";
2
2
  import { s as R } from "./index-CieiGp4Y.js";
3
- import { s as $ } from "./stack-Cf4n9h0N.js";
4
- import { t as B } from "./tensor-DJoc7gJU.js";
3
+ import { s as $ } from "./stack-WJK22CFn.js";
4
+ import { t as B } from "./tensor-BQqrDvpx.js";
5
5
  function _(s, t) {
6
6
  return b(s, t);
7
7
  }
@@ -296,7 +296,7 @@ class i {
296
296
  * throw an `Error`.
297
297
  */
298
298
  handleErrors(t) {
299
- return new j(this, t);
299
+ return new Z(this, t);
300
300
  }
301
301
  // TODO(soergel): Implement reduce() etc.
302
302
  /**
@@ -623,7 +623,7 @@ class K extends i {
623
623
  return { value: r, done: !1 };
624
624
  }
625
625
  }
626
- class j extends i {
626
+ class Z extends i {
627
627
  constructor(t, e) {
628
628
  super(), this.upstream = t, this.handler = e, this.count = 0, this.lastRead = Promise.resolve({ value: null, done: !1 });
629
629
  }
@@ -660,7 +660,7 @@ class w extends i {
660
660
  return { value: r, done: !1 };
661
661
  }
662
662
  }
663
- class Z extends i {
663
+ class j extends i {
664
664
  constructor() {
665
665
  super(), this.outputQueue = new f(), this.lastRead = Promise.resolve({ value: null, done: !1 });
666
666
  }
@@ -674,7 +674,7 @@ class Z extends i {
674
674
  return { value: this.outputQueue.shift(), done: !1 };
675
675
  }
676
676
  }
677
- class tt extends Z {
677
+ class tt extends j {
678
678
  constructor(t, e) {
679
679
  super(), this.upstream = t, this.transform = e;
680
680
  }