webslm 0.7.0 → 0.9.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 (41) hide show
  1. package/README.md +85 -2
  2. package/dist/ai-sdk/embedding-model.d.ts +52 -0
  3. package/dist/ai-sdk/embedding-model.js +112 -0
  4. package/dist/ai-sdk/image-model.d.ts +53 -0
  5. package/dist/ai-sdk/image-model.js +148 -0
  6. package/dist/ai-sdk/index.d.ts +39 -0
  7. package/dist/ai-sdk/index.js +66 -11
  8. package/dist/client.d.ts +6 -0
  9. package/dist/client.js +8 -1
  10. package/dist/download.js +2 -2
  11. package/dist/engine.js +181 -0
  12. package/dist/errors.d.ts +5 -0
  13. package/dist/errors.js +1 -0
  14. package/dist/hub.d.ts +38 -3
  15. package/dist/hub.js +87 -8
  16. package/dist/image.d.ts +201 -0
  17. package/dist/image.js +353 -0
  18. package/dist/index.d.ts +5 -3
  19. package/dist/index.js +4 -2
  20. package/dist/models.d.ts +19 -1
  21. package/dist/models.js +45 -6
  22. package/dist/native.d.ts +28 -0
  23. package/dist/protocol.d.ts +75 -2
  24. package/dist/simple.d.ts +4 -1
  25. package/dist/simple.js +9 -2
  26. package/dist/types.d.ts +39 -1
  27. package/dist/wasm.d.ts +2 -0
  28. package/native-manifest.json +29 -29
  29. package/package.json +1 -1
  30. package/wasm/relaxed/webslm_wasm.d.ts +70 -6
  31. package/wasm/relaxed/webslm_wasm.js +163 -18
  32. package/wasm/relaxed/webslm_wasm_bg.wasm +0 -0
  33. package/wasm/relaxed/webslm_wasm_bg.wasm.d.ts +10 -3
  34. package/wasm/simd/webslm_wasm.d.ts +70 -6
  35. package/wasm/simd/webslm_wasm.js +163 -18
  36. package/wasm/simd/webslm_wasm_bg.wasm +0 -0
  37. package/wasm/simd/webslm_wasm_bg.wasm.d.ts +10 -3
  38. package/wasm/threads/webslm_wasm.d.ts +71 -7
  39. package/wasm/threads/webslm_wasm.js +168 -23
  40. package/wasm/threads/webslm_wasm_bg.wasm +0 -0
  41. package/wasm/threads/webslm_wasm_bg.wasm.d.ts +11 -4
@@ -119,9 +119,89 @@ export class Sha256Hasher {
119
119
  }
120
120
  if (Symbol.dispose) Sha256Hasher.prototype[Symbol.dispose] = Sha256Hasher.prototype.free;
121
121
 
122
+ /**
123
+ * A loaded text-to-image pipeline.
124
+ */
125
+ export class WasmImageModel {
126
+ static __wrap(ptr) {
127
+ const obj = Object.create(WasmImageModel.prototype);
128
+ obj.__wbg_ptr = ptr;
129
+ WasmImageModelFinalization.register(obj, obj.__wbg_ptr, obj);
130
+ return obj;
131
+ }
132
+ __destroy_into_raw() {
133
+ const ptr = this.__wbg_ptr;
134
+ this.__wbg_ptr = 0;
135
+ WasmImageModelFinalization.unregister(this);
136
+ return ptr;
137
+ }
138
+ free() {
139
+ const ptr = this.__destroy_into_raw();
140
+ wasm.__wbg_wasmimagemodel_free(ptr, 0);
141
+ }
142
+ /**
143
+ * Generates an image of `prompt`. `options_json`: `{ width?, height?,
144
+ * steps?, guidance?, seed?, negativePrompt? }` (see `ImageOptionsJs`).
145
+ * `on_progress(phase, step, steps)` is called before encoding the
146
+ * prompt, before each denoising step and before decoding; returning
147
+ * `false` stops the generation (it rejects with `"ABORTED"`).
148
+ * Resolves to `{ width, height, seed, rgba: Uint8Array }` (row-major
149
+ * 8-bit RGBA).
150
+ * @param {string} prompt
151
+ * @param {string} options_json
152
+ * @param {Function | null} [on_progress]
153
+ * @returns {Promise<any>}
154
+ */
155
+ generate(prompt, options_json, on_progress) {
156
+ const ptr0 = passStringToWasm0(prompt, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
157
+ const len0 = WASM_VECTOR_LEN;
158
+ const ptr1 = passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
159
+ const len1 = WASM_VECTOR_LEN;
160
+ const ret = wasm.wasmimagemodel_generate(this.__wbg_ptr, ptr0, len0, ptr1, len1, isLikeNone(on_progress) ? 0 : addToExternrefTable0(on_progress));
161
+ return ret;
162
+ }
163
+ /**
164
+ * Describes the pipeline (see [`ImageModelInfo`]).
165
+ * @returns {any}
166
+ */
167
+ info() {
168
+ const ret = wasm.wasmimagemodel_info(this.__wbg_ptr);
169
+ if (ret[2]) {
170
+ throw takeFromExternrefTable0(ret[1]);
171
+ }
172
+ return takeFromExternrefTable0(ret[0]);
173
+ }
174
+ /**
175
+ * Loads a pipeline from `source`. `options_json`:
176
+ * `{ format?: "f16" | "f32" | "bf16" | "q8" | ..., device?: "cpu" |
177
+ * "webgpu" | "auto" }` (defaults: f16 weights, `auto`). `decoder`,
178
+ * when given, serves a standalone autoencoder (`config.json` and
179
+ * `diffusion_pytorch_model.safetensors`, e.g. `madebyollin/taesd`)
180
+ * that replaces the pipeline's decoder.
181
+ * @param {JsSource} source
182
+ * @param {string} options_json
183
+ * @param {JsSource | null} [decoder]
184
+ * @returns {Promise<WasmImageModel>}
185
+ */
186
+ static load(source, options_json, decoder) {
187
+ _assertClass(source, JsSource);
188
+ var ptr0 = source.__destroy_into_raw();
189
+ const ptr1 = passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
190
+ const len1 = WASM_VECTOR_LEN;
191
+ let ptr2 = 0;
192
+ if (!isLikeNone(decoder)) {
193
+ _assertClass(decoder, JsSource);
194
+ ptr2 = decoder.__destroy_into_raw();
195
+ }
196
+ const ret = wasm.wasmimagemodel_load(ptr0, ptr1, len1, ptr2);
197
+ return ret;
198
+ }
199
+ }
200
+ if (Symbol.dispose) WasmImageModel.prototype[Symbol.dispose] = WasmImageModel.prototype.free;
201
+
122
202
  /**
123
203
  * A loaded checkpoint, with a default session used by `chat` and
124
- * `generate`.
204
+ * `generate` (language models), or an encoder answering `embed`.
125
205
  */
126
206
  export class WasmModel {
127
207
  static __wrap(ptr) {
@@ -236,6 +316,27 @@ export class WasmModel {
236
316
  wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
237
317
  }
238
318
  }
319
+ /**
320
+ * Embeds texts with an encoder. `texts_json` is a JSON array of
321
+ * strings; `options_json`: `{ pooling?: "cls" | "mean" | "max" |
322
+ * "mean_sqrt_len_tokens" | "weightedmean" | "lasttoken", normalize?:
323
+ * boolean }` (defaults: the model's sentence-transformers settings).
324
+ * Resolves to `{ data: Float32Array, dimensions: number, tokens:
325
+ * number[] }`: the vectors one after the other, and the number of
326
+ * tokens read from each text (texts longer than the model's limit are
327
+ * cut). Rejects with `UNSUPPORTED_TASK` on a language model.
328
+ * @param {string} texts_json
329
+ * @param {string} options_json
330
+ * @returns {Promise<any>}
331
+ */
332
+ embed(texts_json, options_json) {
333
+ const ptr0 = passStringToWasm0(texts_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
334
+ const len0 = WASM_VECTOR_LEN;
335
+ const ptr1 = passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
336
+ const len1 = WASM_VECTOR_LEN;
337
+ const ret = wasm.wasmmodel_embed(this.__wbg_ptr, ptr0, len0, ptr1, len1);
338
+ return ret;
339
+ }
239
340
  /**
240
341
  * Completes raw text in the default session; see
241
342
  * [`WasmSession::generate`].
@@ -264,6 +365,14 @@ export class WasmModel {
264
365
  }
265
366
  return takeFromExternrefTable0(ret[0]);
266
367
  }
368
+ /**
369
+ * Whether the model is an encoder (it answers `embed`, not `chat`).
370
+ * @returns {boolean}
371
+ */
372
+ get isEncoder() {
373
+ const ret = wasm.wasmmodel_isEncoder(this.__wbg_ptr);
374
+ return ret !== 0;
375
+ }
267
376
  /**
268
377
  * Loads a checkpoint from `source`. `options_json` is a JSON object:
269
378
  * `{ format?: "q8" | "q4" | "q4_0" | "f32" | "f16" | "bf16",
@@ -297,6 +406,9 @@ export class WasmModel {
297
406
  * `format`, a pre-quantized checkpoint (a `Q8_0` GGUF file, a
298
407
  * `webslm export` checkpoint) loads in its own format, its blocks
299
408
  * unchanged; weights already in the load format skip `weightCache`.
409
+ *
410
+ * An encoder loads in f32 unless `format` says otherwise, and takes
411
+ * no `lora`.
300
412
  * @param {JsSource} source
301
413
  * @param {string} options_json
302
414
  * @param {JsSource | null} [lora]
@@ -363,7 +475,7 @@ export class WasmModel {
363
475
  }
364
476
  }
365
477
  /**
366
- * Clears the default session.
478
+ * Clears the default session (nothing to clear for an encoder).
367
479
  */
368
480
  reset() {
369
481
  const ret = wasm.wasmmodel_reset(this.__wbg_ptr);
@@ -372,7 +484,8 @@ export class WasmModel {
372
484
  }
373
485
  }
374
486
  /**
375
- * Encodes text into token ids.
487
+ * Encodes text into token ids (an encoder's tokenizer cuts texts at
488
+ * its limit, as `embed` does).
376
489
  * @param {string} text
377
490
  * @param {boolean} add_special_tokens
378
491
  * @returns {Uint32Array}
@@ -692,6 +805,18 @@ export function startThreadPool(threads) {
692
805
  return ret;
693
806
  }
694
807
 
808
+ /**
809
+ * `model_type` values of the encoders this build embeds with (models
810
+ * whose `WasmModel` answers `embed`).
811
+ * @returns {string[]}
812
+ */
813
+ export function supportedEncoderTypes() {
814
+ const ret = wasm.supportedEncoderTypes();
815
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]);
816
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
817
+ return v1;
818
+ }
819
+
695
820
  /**
696
821
  * `model_type` values (from `config.json`) of the architectures this build
697
822
  * can run.
@@ -786,6 +911,11 @@ function __wbg_get_imports(memory) {
786
911
  const ret = arg0.WorkerGlobalScope;
787
912
  return ret;
788
913
  },
914
+ __wbg___wbindgen_boolean_get_7a12af2b3f899c5a: function(arg0) {
915
+ const v = arg0;
916
+ const ret = typeof(v) === 'boolean' ? v : undefined;
917
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
918
+ },
789
919
  __wbg___wbindgen_debug_string_0e68cf47c9cbd9b0: function(arg0, arg1) {
790
920
  const ret = debugString(arg1);
791
921
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
@@ -1270,6 +1400,10 @@ function __wbg_get_imports(memory) {
1270
1400
  const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
1271
1401
  return ret;
1272
1402
  },
1403
+ __wbg_new_from_slice_a500ec81601be48f: function(arg0, arg1) {
1404
+ const ret = new Uint32Array(getArrayU32FromWasm0(arg0, arg1));
1405
+ return ret;
1406
+ },
1273
1407
  __wbg_new_typed_6f8b0d724fe26c07: function(arg0, arg1) {
1274
1408
  try {
1275
1409
  var state0 = {a: arg0, b: arg1};
@@ -1348,6 +1482,10 @@ function __wbg_get_imports(memory) {
1348
1482
  const ret = arg0.reason;
1349
1483
  return (__wbindgen_enum_GpuDeviceLostReason.indexOf(ret) + 1 || 3) - 1;
1350
1484
  },
1485
+ __wbg_reject_bea6d825081bd4d7: function(arg0) {
1486
+ const ret = Promise.reject(arg0);
1487
+ return ret;
1488
+ },
1351
1489
  __wbg_requestAdapter_2cb1006baf7abd60: function(arg0) {
1352
1490
  const ret = arg0.requestAdapter();
1353
1491
  return ret;
@@ -1636,6 +1774,10 @@ function __wbg_get_imports(memory) {
1636
1774
  const ret = Atomics.waitAsync;
1637
1775
  return ret;
1638
1776
  },
1777
+ __wbg_wasmimagemodel_new: function(arg0) {
1778
+ const ret = WasmImageModel.__wrap(arg0);
1779
+ return ret;
1780
+ },
1639
1781
  __wbg_wasmmodel_new: function(arg0) {
1640
1782
  const ret = WasmModel.__wrap(arg0);
1641
1783
  return ret;
@@ -1644,43 +1786,43 @@ function __wbg_get_imports(memory) {
1644
1786
  arg0.writeBuffer(arg1, arg2, getArrayU8FromWasm0(arg3, arg4), arg5, arg6);
1645
1787
  }, arguments); },
1646
1788
  __wbindgen_generic_0000000000000001: function(arg0, arg1) {
1647
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 392, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1789
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 434, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1648
1790
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true_);
1649
1791
  return ret;
1650
1792
  },
1651
1793
  __wbindgen_generic_0000000000000002: function(arg0, arg1) {
1652
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 932, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1794
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 981, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1653
1795
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue__core_2b10d7c4e784534e___result__Result_____wasm_bindgen_3c612a990bfab728___JsError___true_);
1654
1796
  return ret;
1655
1797
  },
1656
1798
  __wbindgen_generic_0000000000000003: function(arg0, arg1) {
1657
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 934, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1799
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 983, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1658
1800
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___js_sys_b608be85a12bc1d0___futures__task__wait_async_polyfill__MessageEvent______true_);
1659
1801
  return ret;
1660
1802
  },
1661
1803
  __wbindgen_generic_0000000000000004: function(arg0, arg1) {
1662
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUDevice")], shim_idx: 390, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1804
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUDevice")], shim_idx: 432, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1663
1805
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___sys__JsNullable_wgpu_4ecf802b864e9046___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_2b10d7c4e784534e___result__Result_____wasm_bindgen_3c612a990bfab728___JsError___true_);
1664
1806
  return ret;
1665
1807
  },
1666
1808
  __wbindgen_generic_0000000000000005: function(arg0, arg1) {
1667
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUDeviceLostInfo")], shim_idx: 392, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1668
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true__46);
1809
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUDeviceLostInfo")], shim_idx: 434, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1810
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true__52);
1669
1811
  return ret;
1670
1812
  },
1671
1813
  __wbindgen_generic_0000000000000006: function(arg0, arg1) {
1672
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUUncapturedErrorEvent")], shim_idx: 392, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1673
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true__47);
1814
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUUncapturedErrorEvent")], shim_idx: 434, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1815
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true__53);
1674
1816
  return ret;
1675
1817
  },
1676
1818
  __wbindgen_generic_0000000000000007: function(arg0, arg1) {
1677
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("any")], shim_idx: 390, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1678
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___sys__JsNullable_wgpu_4ecf802b864e9046___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_2b10d7c4e784534e___result__Result_____wasm_bindgen_3c612a990bfab728___JsError___true__48);
1819
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("any")], shim_idx: 432, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1820
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___sys__JsNullable_wgpu_4ecf802b864e9046___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_2b10d7c4e784534e___result__Result_____wasm_bindgen_3c612a990bfab728___JsError___true__54);
1679
1821
  return ret;
1680
1822
  },
1681
1823
  __wbindgen_generic_0000000000000008: function(arg0, arg1) {
1682
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("undefined")], shim_idx: 390, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1683
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___sys__JsNullable_wgpu_4ecf802b864e9046___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_2b10d7c4e784534e___result__Result_____wasm_bindgen_3c612a990bfab728___JsError___true__49);
1824
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("undefined")], shim_idx: 432, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1825
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___sys__JsNullable_wgpu_4ecf802b864e9046___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_2b10d7c4e784534e___result__Result_____wasm_bindgen_3c612a990bfab728___JsError___true__55);
1684
1826
  return ret;
1685
1827
  },
1686
1828
  __wbindgen_generic_0000000000000009: function(arg0) {
@@ -1742,12 +1884,12 @@ function wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___js_sys_b
1742
1884
  wasm.wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___js_sys_b608be85a12bc1d0___futures__task__wait_async_polyfill__MessageEvent______true_(arg0, arg1, arg2);
1743
1885
  }
1744
1886
 
1745
- function wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true__46(arg0, arg1, arg2) {
1746
- wasm.wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true__46(arg0, arg1, arg2);
1887
+ function wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true__52(arg0, arg1, arg2) {
1888
+ wasm.wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true__52(arg0, arg1, arg2);
1747
1889
  }
1748
1890
 
1749
- function wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true__47(arg0, arg1, arg2) {
1750
- wasm.wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true__47(arg0, arg1, arg2);
1891
+ function wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true__53(arg0, arg1, arg2) {
1892
+ wasm.wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true__53(arg0, arg1, arg2);
1751
1893
  }
1752
1894
 
1753
1895
  function wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue__core_2b10d7c4e784534e___result__Result_____wasm_bindgen_3c612a990bfab728___JsError___true_(arg0, arg1, arg2) {
@@ -1764,15 +1906,15 @@ function wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bin
1764
1906
  }
1765
1907
  }
1766
1908
 
1767
- function wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___sys__JsNullable_wgpu_4ecf802b864e9046___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_2b10d7c4e784534e___result__Result_____wasm_bindgen_3c612a990bfab728___JsError___true__48(arg0, arg1, arg2) {
1768
- const ret = wasm.wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___sys__JsNullable_wgpu_4ecf802b864e9046___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_2b10d7c4e784534e___result__Result_____wasm_bindgen_3c612a990bfab728___JsError___true__48(arg0, arg1, arg2);
1909
+ function wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___sys__JsNullable_wgpu_4ecf802b864e9046___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_2b10d7c4e784534e___result__Result_____wasm_bindgen_3c612a990bfab728___JsError___true__54(arg0, arg1, arg2) {
1910
+ const ret = wasm.wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___sys__JsNullable_wgpu_4ecf802b864e9046___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_2b10d7c4e784534e___result__Result_____wasm_bindgen_3c612a990bfab728___JsError___true__54(arg0, arg1, arg2);
1769
1911
  if (ret[1]) {
1770
1912
  throw takeFromExternrefTable0(ret[0]);
1771
1913
  }
1772
1914
  }
1773
1915
 
1774
- function wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___sys__JsNullable_wgpu_4ecf802b864e9046___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_2b10d7c4e784534e___result__Result_____wasm_bindgen_3c612a990bfab728___JsError___true__49(arg0, arg1, arg2) {
1775
- const ret = wasm.wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___sys__JsNullable_wgpu_4ecf802b864e9046___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_2b10d7c4e784534e___result__Result_____wasm_bindgen_3c612a990bfab728___JsError___true__49(arg0, arg1, arg2);
1916
+ function wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___sys__JsNullable_wgpu_4ecf802b864e9046___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_2b10d7c4e784534e___result__Result_____wasm_bindgen_3c612a990bfab728___JsError___true__55(arg0, arg1, arg2) {
1917
+ const ret = wasm.wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___sys__JsNullable_wgpu_4ecf802b864e9046___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_2b10d7c4e784534e___result__Result_____wasm_bindgen_3c612a990bfab728___JsError___true__55(arg0, arg1, arg2);
1776
1918
  if (ret[1]) {
1777
1919
  throw takeFromExternrefTable0(ret[0]);
1778
1920
  }
@@ -1820,6 +1962,9 @@ const JsWeightCacheFinalization = (typeof FinalizationRegistry === 'undefined')
1820
1962
  const Sha256HasherFinalization = (typeof FinalizationRegistry === 'undefined')
1821
1963
  ? { register: () => {}, unregister: () => {} }
1822
1964
  : new FinalizationRegistry(ptr => wasm.__wbg_sha256hasher_free(ptr, 1));
1965
+ const WasmImageModelFinalization = (typeof FinalizationRegistry === 'undefined')
1966
+ ? { register: () => {}, unregister: () => {} }
1967
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmimagemodel_free(ptr, 1));
1823
1968
  const WasmModelFinalization = (typeof FinalizationRegistry === 'undefined')
1824
1969
  ? { register: () => {}, unregister: () => {} }
1825
1970
  : new FinalizationRegistry(ptr => wasm.__wbg_wasmmodel_free(ptr, 1));
Binary file
@@ -3,6 +3,7 @@
3
3
  export const __wbg_jssource_free: (a: number, b: number) => void;
4
4
  export const __wbg_jsweightcache_free: (a: number, b: number) => void;
5
5
  export const __wbg_sha256hasher_free: (a: number, b: number) => void;
6
+ export const __wbg_wasmimagemodel_free: (a: number, b: number) => void;
6
7
  export const __wbg_wasmmodel_free: (a: number, b: number) => void;
7
8
  export const __wbg_wasmsession_free: (a: number, b: number) => void;
8
9
  export const __wbg_wbg_rayon_poolbuilder_free: (a: number, b: number) => void;
@@ -15,15 +16,21 @@ export const sha256hasher_finish: (a: number) => [number, number];
15
16
  export const sha256hasher_new: () => number;
16
17
  export const sha256hasher_update: (a: number, b: number, c: number) => void;
17
18
  export const startThreadPool: (a: number) => any;
19
+ export const supportedEncoderTypes: () => [number, number];
18
20
  export const supportedModelTypes: () => [number, number];
19
21
  export const version: () => [number, number];
22
+ export const wasmimagemodel_generate: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
23
+ export const wasmimagemodel_info: (a: number) => [number, number, number];
24
+ export const wasmimagemodel_load: (a: number, b: number, c: number, d: number) => any;
20
25
  export const wasmmodel_applyAdapter: (a: number, b: number, c: number, d: number) => any;
21
26
  export const wasmmodel_chat: (a: number, b: number, c: number, d: number, e: number, f: any, g: number) => any;
22
27
  export const wasmmodel_chatWithMedia: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: any, k: number) => any;
23
28
  export const wasmmodel_createSession: (a: number) => [number, number, number];
24
29
  export const wasmmodel_detokenize: (a: number, b: number, c: number, d: number) => [number, number, number, number];
30
+ export const wasmmodel_embed: (a: number, b: number, c: number, d: number, e: number) => any;
25
31
  export const wasmmodel_generate: (a: number, b: number, c: number, d: number, e: number, f: any, g: number) => any;
26
32
  export const wasmmodel_info: (a: number) => [number, number, number];
33
+ export const wasmmodel_isEncoder: (a: number) => number;
27
34
  export const wasmmodel_load: (a: number, b: number, c: number, d: number, e: number) => any;
28
35
  export const wasmmodel_removeAdapter: (a: number) => any;
29
36
  export const wasmmodel_renderChat: (a: number, b: number, c: number, d: number, e: number) => [number, number, number, number];
@@ -50,12 +57,12 @@ export const wbg_rayon_start_worker: (a: number) => void;
50
57
  export const wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___js_sys_b608be85a12bc1d0___Function_fn_wasm_bindgen_3c612a990bfab728___JsValue_____wasm_bindgen_3c612a990bfab728___sys__Undefined___js_sys_b608be85a12bc1d0___Function_fn_wasm_bindgen_3c612a990bfab728___JsValue_____wasm_bindgen_3c612a990bfab728___sys__Undefined_______true_: (a: number, b: number, c: any, d: any) => void;
51
58
  export const wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue__core_2b10d7c4e784534e___result__Result_____wasm_bindgen_3c612a990bfab728___JsError___true_: (a: number, b: number, c: any) => [number, number];
52
59
  export const wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___sys__JsNullable_wgpu_4ecf802b864e9046___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_2b10d7c4e784534e___result__Result_____wasm_bindgen_3c612a990bfab728___JsError___true_: (a: number, b: number, c: any) => [number, number];
53
- export const wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___sys__JsNullable_wgpu_4ecf802b864e9046___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_2b10d7c4e784534e___result__Result_____wasm_bindgen_3c612a990bfab728___JsError___true__48: (a: number, b: number, c: any) => [number, number];
54
- export const wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___sys__JsNullable_wgpu_4ecf802b864e9046___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_2b10d7c4e784534e___result__Result_____wasm_bindgen_3c612a990bfab728___JsError___true__49: (a: number, b: number, c: any) => [number, number];
60
+ export const wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___sys__JsNullable_wgpu_4ecf802b864e9046___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_2b10d7c4e784534e___result__Result_____wasm_bindgen_3c612a990bfab728___JsError___true__54: (a: number, b: number, c: any) => [number, number];
61
+ export const wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___sys__JsNullable_wgpu_4ecf802b864e9046___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_2b10d7c4e784534e___result__Result_____wasm_bindgen_3c612a990bfab728___JsError___true__55: (a: number, b: number, c: any) => [number, number];
55
62
  export const wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___js_sys_b608be85a12bc1d0___futures__task__wait_async_polyfill__MessageEvent______true_: (a: number, b: number, c: any) => void;
56
63
  export const wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true_: (a: number, b: number, c: any) => void;
57
- export const wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true__46: (a: number, b: number, c: any) => void;
58
- export const wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true__47: (a: number, b: number, c: any) => void;
64
+ export const wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true__52: (a: number, b: number, c: any) => void;
65
+ export const wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true__53: (a: number, b: number, c: any) => void;
59
66
  export const memory: WebAssembly.Memory;
60
67
  export const __wbindgen_malloc: (a: number, b: number) => number;
61
68
  export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;