webslm 0.4.1 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/README.md +35 -5
  2. package/dist/ai-sdk/language-model.d.ts +4 -1
  3. package/dist/ai-sdk/language-model.js +6 -3
  4. package/dist/ai-sdk/prompt.d.ts +5 -3
  5. package/dist/ai-sdk/prompt.js +57 -5
  6. package/dist/cache/models.d.ts +4 -3
  7. package/dist/cache/models.js +25 -12
  8. package/dist/client.d.ts +1 -2
  9. package/dist/curated.js +9 -0
  10. package/dist/download.d.ts +5 -0
  11. package/dist/download.js +11 -6
  12. package/dist/engine.js +50 -14
  13. package/dist/fit.d.ts +1 -1
  14. package/dist/fit.js +2 -1
  15. package/dist/hub.d.ts +22 -2
  16. package/dist/hub.js +60 -5
  17. package/dist/index.d.ts +1 -1
  18. package/dist/media.d.ts +72 -0
  19. package/dist/media.js +358 -0
  20. package/dist/memory.d.ts +5 -0
  21. package/dist/memory.js +47 -6
  22. package/dist/models.d.ts +13 -4
  23. package/dist/models.js +112 -20
  24. package/dist/native.d.ts +3 -0
  25. package/dist/protocol.d.ts +32 -1
  26. package/dist/recommended-sampling.js +6 -1
  27. package/dist/simple.d.ts +11 -2
  28. package/dist/simple.js +17 -8
  29. package/dist/types.d.ts +109 -2
  30. package/native-manifest.json +29 -29
  31. package/package.json +1 -1
  32. package/wasm/relaxed/webslm_wasm.d.ts +29 -4
  33. package/wasm/relaxed/webslm_wasm.js +75 -16
  34. package/wasm/relaxed/webslm_wasm_bg.wasm +0 -0
  35. package/wasm/relaxed/webslm_wasm_bg.wasm.d.ts +5 -3
  36. package/wasm/simd/webslm_wasm.d.ts +29 -4
  37. package/wasm/simd/webslm_wasm.js +75 -16
  38. package/wasm/simd/webslm_wasm_bg.wasm +0 -0
  39. package/wasm/simd/webslm_wasm_bg.wasm.d.ts +5 -3
  40. package/wasm/threads/webslm_wasm.d.ts +30 -5
  41. package/wasm/threads/webslm_wasm.js +80 -21
  42. package/wasm/threads/webslm_wasm_bg.wasm +0 -0
  43. package/wasm/threads/webslm_wasm_bg.wasm.d.ts +6 -4
@@ -157,6 +157,29 @@ export class WasmModel {
157
157
  const ret = wasm.wasmmodel_applyAdapter(this.__wbg_ptr, ptr0, ptr1, len1);
158
158
  return ret;
159
159
  }
160
+ /**
161
+ * Answers a conversation with images or videos in the default
162
+ * session; see [`WasmSession::chat_with_media`].
163
+ * @param {string} messages_json
164
+ * @param {string} options_json
165
+ * @param {string} media_json
166
+ * @param {Uint8Array} media_data
167
+ * @param {Function} on_delta
168
+ * @param {Function | null} [on_prefill]
169
+ * @returns {Promise<any>}
170
+ */
171
+ chatWithMedia(messages_json, options_json, media_json, media_data, on_delta, on_prefill) {
172
+ const ptr0 = passStringToWasm0(messages_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
173
+ const len0 = WASM_VECTOR_LEN;
174
+ const ptr1 = passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
175
+ const len1 = WASM_VECTOR_LEN;
176
+ const ptr2 = passStringToWasm0(media_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
177
+ const len2 = WASM_VECTOR_LEN;
178
+ const ptr3 = passArray8ToWasm0(media_data, wasm.__wbindgen_malloc);
179
+ const len3 = WASM_VECTOR_LEN;
180
+ const ret = wasm.wasmmodel_chatWithMedia(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, on_delta, isLikeNone(on_prefill) ? 0 : addToExternrefTable0(on_prefill));
181
+ return ret;
182
+ }
160
183
  /**
161
184
  * Answers a conversation in the default session; see
162
185
  * [`WasmSession::chat`].
@@ -244,7 +267,9 @@ export class WasmModel {
244
267
  * `{ format?: "q8" | "q4" | "q4_0" | "f32" | "f16" | "bf16",
245
268
  * contextLength?: number, deterministic?: boolean,
246
269
  * activations?: "quantized" | "f32", device?: "cpu" | "webgpu" | "auto",
247
- * adapterScale?: number, adapterMode?: "unmerged" | "merged" }`.
270
+ * adapterScale?: number, adapterMode?: "unmerged" | "merged",
271
+ * vision?: boolean }` (`vision: false` skips the vision encoder of a
272
+ * vision-language checkpoint).
248
273
  *
249
274
  * `device` defaults to `"cpu"`. `"auto"` picks WebGPU when an adapter
250
275
  * is available and the model has more than
@@ -263,6 +288,12 @@ export class WasmModel {
263
288
  * weights: a valid stored file serves them instead of converting the
264
289
  * checkpoint, else they are written to it as they are converted;
265
290
  * `info().weightCache` says which (see [`WeightCacheOutcome`]).
291
+ *
292
+ * `ggufFile` loads that GGUF file of the source (a source listing
293
+ * GGUF files and no safetensors loads its preferred one). Without
294
+ * `format`, a pre-quantized checkpoint (a `Q8_0` GGUF file, a
295
+ * `webslm export` checkpoint) loads in its own format, its blocks
296
+ * unchanged; weights already in the load format skip `weightCache`.
266
297
  * @param {JsSource} source
267
298
  * @param {string} options_json
268
299
  * @param {JsSource | null} [lora]
@@ -388,6 +419,34 @@ export class WasmSession {
388
419
  }
389
420
  return ret[0] >>> 0;
390
421
  }
422
+ /**
423
+ * Answers a conversation whose messages hold image or video parts
424
+ * (`{"type": "image"}`, `{"type": "video"}`), with a vision-language
425
+ * model. `media_json` describes the images and videos, one per part in
426
+ * order, and `media_data` holds their RGBA pixels back to back (see
427
+ * `webslm_bindings::media`); the `media` generation option sets the
428
+ * video sampling (`maxFrames`, `fps`) and processor settings. Same
429
+ * callbacks and result as [`WasmSession::chat`].
430
+ * @param {string} messages_json
431
+ * @param {string} options_json
432
+ * @param {string} media_json
433
+ * @param {Uint8Array} media_data
434
+ * @param {Function} on_delta
435
+ * @param {Function | null} [on_prefill]
436
+ * @returns {Promise<any>}
437
+ */
438
+ chatWithMedia(messages_json, options_json, media_json, media_data, on_delta, on_prefill) {
439
+ const ptr0 = passStringToWasm0(messages_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
440
+ const len0 = WASM_VECTOR_LEN;
441
+ const ptr1 = passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
442
+ const len1 = WASM_VECTOR_LEN;
443
+ const ptr2 = passStringToWasm0(media_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
444
+ const len2 = WASM_VECTOR_LEN;
445
+ const ptr3 = passArray8ToWasm0(media_data, wasm.__wbindgen_malloc);
446
+ const len3 = WASM_VECTOR_LEN;
447
+ const ret = wasm.wasmsession_chatWithMedia(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, on_delta, isLikeNone(on_prefill) ? 0 : addToExternrefTable0(on_prefill));
448
+ return ret;
449
+ }
391
450
  /**
392
451
  * Answers a conversation: `messages_json` is a JSON array of
393
452
  * `{ role, content }`, `options_json` a JSON object of generation
@@ -1424,33 +1483,33 @@ function __wbg_get_imports() {
1424
1483
  arg0.writeBuffer(arg1, arg2, getArrayU8FromWasm0(arg3, arg4), arg5, arg6);
1425
1484
  }, arguments); },
1426
1485
  __wbindgen_generic_0000000000000001: function(arg0, arg1) {
1427
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 303, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1486
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 321, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1428
1487
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen_8cf186fa7724d16d___convert__closures_____invoke___wasm_bindgen_8cf186fa7724d16d___JsValue__core_608f92abc48d28da___result__Result_____wasm_bindgen_8cf186fa7724d16d___JsError___true_);
1429
1488
  return ret;
1430
1489
  },
1431
1490
  __wbindgen_generic_0000000000000002: function(arg0, arg1) {
1432
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUDevice")], shim_idx: 236, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1491
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUDevice")], shim_idx: 253, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1433
1492
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen_8cf186fa7724d16d___convert__closures_____invoke___wasm_bindgen_8cf186fa7724d16d___sys__JsNullable_wgpu_54917290532eaf6b___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_608f92abc48d28da___result__Result_____wasm_bindgen_8cf186fa7724d16d___JsError___true_);
1434
1493
  return ret;
1435
1494
  },
1436
1495
  __wbindgen_generic_0000000000000003: function(arg0, arg1) {
1437
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUDeviceLostInfo")], shim_idx: 240, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1496
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUDeviceLostInfo")], shim_idx: 257, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1438
1497
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen_8cf186fa7724d16d___convert__closures_____invoke___wgpu_54917290532eaf6b___backend__webgpu__webgpu_sys__gen_GpuDeviceLostInfo__GpuDeviceLostInfo______true_);
1439
1498
  return ret;
1440
1499
  },
1441
1500
  __wbindgen_generic_0000000000000004: function(arg0, arg1) {
1442
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUUncapturedErrorEvent")], shim_idx: 240, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1443
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen_8cf186fa7724d16d___convert__closures_____invoke___wgpu_54917290532eaf6b___backend__webgpu__webgpu_sys__gen_GpuDeviceLostInfo__GpuDeviceLostInfo______true__37);
1501
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUUncapturedErrorEvent")], shim_idx: 257, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1502
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_8cf186fa7724d16d___convert__closures_____invoke___wgpu_54917290532eaf6b___backend__webgpu__webgpu_sys__gen_GpuDeviceLostInfo__GpuDeviceLostInfo______true__39);
1444
1503
  return ret;
1445
1504
  },
1446
1505
  __wbindgen_generic_0000000000000005: function(arg0, arg1) {
1447
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("any")], shim_idx: 236, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1448
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen_8cf186fa7724d16d___convert__closures_____invoke___wasm_bindgen_8cf186fa7724d16d___sys__JsNullable_wgpu_54917290532eaf6b___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_608f92abc48d28da___result__Result_____wasm_bindgen_8cf186fa7724d16d___JsError___true__38);
1506
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("any")], shim_idx: 253, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1507
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_8cf186fa7724d16d___convert__closures_____invoke___wasm_bindgen_8cf186fa7724d16d___sys__JsNullable_wgpu_54917290532eaf6b___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_608f92abc48d28da___result__Result_____wasm_bindgen_8cf186fa7724d16d___JsError___true__40);
1449
1508
  return ret;
1450
1509
  },
1451
1510
  __wbindgen_generic_0000000000000006: function(arg0, arg1) {
1452
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("undefined")], shim_idx: 236, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1453
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen_8cf186fa7724d16d___convert__closures_____invoke___wasm_bindgen_8cf186fa7724d16d___sys__JsNullable_wgpu_54917290532eaf6b___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_608f92abc48d28da___result__Result_____wasm_bindgen_8cf186fa7724d16d___JsError___true__39);
1511
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("undefined")], shim_idx: 253, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1512
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_8cf186fa7724d16d___convert__closures_____invoke___wasm_bindgen_8cf186fa7724d16d___sys__JsNullable_wgpu_54917290532eaf6b___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_608f92abc48d28da___result__Result_____wasm_bindgen_8cf186fa7724d16d___JsError___true__41);
1454
1513
  return ret;
1455
1514
  },
1456
1515
  __wbindgen_generic_0000000000000007: function(arg0) {
@@ -1493,8 +1552,8 @@ function wasm_bindgen_8cf186fa7724d16d___convert__closures_____invoke___wgpu_549
1493
1552
  wasm.wasm_bindgen_8cf186fa7724d16d___convert__closures_____invoke___wgpu_54917290532eaf6b___backend__webgpu__webgpu_sys__gen_GpuDeviceLostInfo__GpuDeviceLostInfo______true_(arg0, arg1, arg2);
1494
1553
  }
1495
1554
 
1496
- function wasm_bindgen_8cf186fa7724d16d___convert__closures_____invoke___wgpu_54917290532eaf6b___backend__webgpu__webgpu_sys__gen_GpuDeviceLostInfo__GpuDeviceLostInfo______true__37(arg0, arg1, arg2) {
1497
- wasm.wasm_bindgen_8cf186fa7724d16d___convert__closures_____invoke___wgpu_54917290532eaf6b___backend__webgpu__webgpu_sys__gen_GpuDeviceLostInfo__GpuDeviceLostInfo______true__37(arg0, arg1, arg2);
1555
+ function wasm_bindgen_8cf186fa7724d16d___convert__closures_____invoke___wgpu_54917290532eaf6b___backend__webgpu__webgpu_sys__gen_GpuDeviceLostInfo__GpuDeviceLostInfo______true__39(arg0, arg1, arg2) {
1556
+ wasm.wasm_bindgen_8cf186fa7724d16d___convert__closures_____invoke___wgpu_54917290532eaf6b___backend__webgpu__webgpu_sys__gen_GpuDeviceLostInfo__GpuDeviceLostInfo______true__39(arg0, arg1, arg2);
1498
1557
  }
1499
1558
 
1500
1559
  function wasm_bindgen_8cf186fa7724d16d___convert__closures_____invoke___wasm_bindgen_8cf186fa7724d16d___JsValue__core_608f92abc48d28da___result__Result_____wasm_bindgen_8cf186fa7724d16d___JsError___true_(arg0, arg1, arg2) {
@@ -1511,15 +1570,15 @@ function wasm_bindgen_8cf186fa7724d16d___convert__closures_____invoke___wasm_bin
1511
1570
  }
1512
1571
  }
1513
1572
 
1514
- function wasm_bindgen_8cf186fa7724d16d___convert__closures_____invoke___wasm_bindgen_8cf186fa7724d16d___sys__JsNullable_wgpu_54917290532eaf6b___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_608f92abc48d28da___result__Result_____wasm_bindgen_8cf186fa7724d16d___JsError___true__38(arg0, arg1, arg2) {
1515
- const ret = wasm.wasm_bindgen_8cf186fa7724d16d___convert__closures_____invoke___wasm_bindgen_8cf186fa7724d16d___sys__JsNullable_wgpu_54917290532eaf6b___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_608f92abc48d28da___result__Result_____wasm_bindgen_8cf186fa7724d16d___JsError___true__38(arg0, arg1, arg2);
1573
+ function wasm_bindgen_8cf186fa7724d16d___convert__closures_____invoke___wasm_bindgen_8cf186fa7724d16d___sys__JsNullable_wgpu_54917290532eaf6b___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_608f92abc48d28da___result__Result_____wasm_bindgen_8cf186fa7724d16d___JsError___true__40(arg0, arg1, arg2) {
1574
+ const ret = wasm.wasm_bindgen_8cf186fa7724d16d___convert__closures_____invoke___wasm_bindgen_8cf186fa7724d16d___sys__JsNullable_wgpu_54917290532eaf6b___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_608f92abc48d28da___result__Result_____wasm_bindgen_8cf186fa7724d16d___JsError___true__40(arg0, arg1, arg2);
1516
1575
  if (ret[1]) {
1517
1576
  throw takeFromExternrefTable0(ret[0]);
1518
1577
  }
1519
1578
  }
1520
1579
 
1521
- function wasm_bindgen_8cf186fa7724d16d___convert__closures_____invoke___wasm_bindgen_8cf186fa7724d16d___sys__JsNullable_wgpu_54917290532eaf6b___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_608f92abc48d28da___result__Result_____wasm_bindgen_8cf186fa7724d16d___JsError___true__39(arg0, arg1, arg2) {
1522
- const ret = wasm.wasm_bindgen_8cf186fa7724d16d___convert__closures_____invoke___wasm_bindgen_8cf186fa7724d16d___sys__JsNullable_wgpu_54917290532eaf6b___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_608f92abc48d28da___result__Result_____wasm_bindgen_8cf186fa7724d16d___JsError___true__39(arg0, arg1, arg2);
1580
+ function wasm_bindgen_8cf186fa7724d16d___convert__closures_____invoke___wasm_bindgen_8cf186fa7724d16d___sys__JsNullable_wgpu_54917290532eaf6b___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_608f92abc48d28da___result__Result_____wasm_bindgen_8cf186fa7724d16d___JsError___true__41(arg0, arg1, arg2) {
1581
+ const ret = wasm.wasm_bindgen_8cf186fa7724d16d___convert__closures_____invoke___wasm_bindgen_8cf186fa7724d16d___sys__JsNullable_wgpu_54917290532eaf6b___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_608f92abc48d28da___result__Result_____wasm_bindgen_8cf186fa7724d16d___JsError___true__41(arg0, arg1, arg2);
1523
1582
  if (ret[1]) {
1524
1583
  throw takeFromExternrefTable0(ret[0]);
1525
1584
  }
Binary file
@@ -17,6 +17,7 @@ export const supportedModelTypes: () => [number, number];
17
17
  export const version: () => [number, number];
18
18
  export const wasmmodel_applyAdapter: (a: number, b: number, c: number, d: number) => any;
19
19
  export const wasmmodel_chat: (a: number, b: number, c: number, d: number, e: number, f: any, g: number) => any;
20
+ 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;
20
21
  export const wasmmodel_createSession: (a: number) => [number, number, number];
21
22
  export const wasmmodel_detokenize: (a: number, b: number, c: number, d: number) => [number, number, number, number];
22
23
  export const wasmmodel_generate: (a: number, b: number, c: number, d: number, e: number, f: any, g: number) => any;
@@ -28,6 +29,7 @@ export const wasmmodel_reset: (a: number) => [number, number];
28
29
  export const wasmmodel_tokenize: (a: number, b: number, c: number, d: number) => [number, number, number, number];
29
30
  export const wasmsession_capacity: (a: number) => [number, number, number];
30
31
  export const wasmsession_chat: (a: number, b: number, c: number, d: number, e: number, f: any, g: number) => any;
32
+ export const wasmsession_chatWithMedia: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: any, k: number) => any;
31
33
  export const wasmsession_computed: (a: number) => [number, number, number];
32
34
  export const wasmsession_fork: (a: number) => [number, number, number];
33
35
  export const wasmsession_generate: (a: number, b: number, c: number, d: number, e: number, f: any, g: number) => any;
@@ -42,10 +44,10 @@ export const wasmsession_truncate: (a: number, b: number) => [number, number];
42
44
  export const wasm_bindgen_8cf186fa7724d16d___convert__closures_____invoke___js_sys_56365fc49d784db6___Function_fn_wasm_bindgen_8cf186fa7724d16d___JsValue_____wasm_bindgen_8cf186fa7724d16d___sys__Undefined___js_sys_56365fc49d784db6___Function_fn_wasm_bindgen_8cf186fa7724d16d___JsValue_____wasm_bindgen_8cf186fa7724d16d___sys__Undefined_______true_: (a: number, b: number, c: any, d: any) => void;
43
45
  export const wasm_bindgen_8cf186fa7724d16d___convert__closures_____invoke___wasm_bindgen_8cf186fa7724d16d___JsValue__core_608f92abc48d28da___result__Result_____wasm_bindgen_8cf186fa7724d16d___JsError___true_: (a: number, b: number, c: any) => [number, number];
44
46
  export const wasm_bindgen_8cf186fa7724d16d___convert__closures_____invoke___wasm_bindgen_8cf186fa7724d16d___sys__JsNullable_wgpu_54917290532eaf6b___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_608f92abc48d28da___result__Result_____wasm_bindgen_8cf186fa7724d16d___JsError___true_: (a: number, b: number, c: any) => [number, number];
45
- export const wasm_bindgen_8cf186fa7724d16d___convert__closures_____invoke___wasm_bindgen_8cf186fa7724d16d___sys__JsNullable_wgpu_54917290532eaf6b___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_608f92abc48d28da___result__Result_____wasm_bindgen_8cf186fa7724d16d___JsError___true__38: (a: number, b: number, c: any) => [number, number];
46
- export const wasm_bindgen_8cf186fa7724d16d___convert__closures_____invoke___wasm_bindgen_8cf186fa7724d16d___sys__JsNullable_wgpu_54917290532eaf6b___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_608f92abc48d28da___result__Result_____wasm_bindgen_8cf186fa7724d16d___JsError___true__39: (a: number, b: number, c: any) => [number, number];
47
+ export const wasm_bindgen_8cf186fa7724d16d___convert__closures_____invoke___wasm_bindgen_8cf186fa7724d16d___sys__JsNullable_wgpu_54917290532eaf6b___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_608f92abc48d28da___result__Result_____wasm_bindgen_8cf186fa7724d16d___JsError___true__40: (a: number, b: number, c: any) => [number, number];
48
+ export const wasm_bindgen_8cf186fa7724d16d___convert__closures_____invoke___wasm_bindgen_8cf186fa7724d16d___sys__JsNullable_wgpu_54917290532eaf6b___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_608f92abc48d28da___result__Result_____wasm_bindgen_8cf186fa7724d16d___JsError___true__41: (a: number, b: number, c: any) => [number, number];
47
49
  export const wasm_bindgen_8cf186fa7724d16d___convert__closures_____invoke___wgpu_54917290532eaf6b___backend__webgpu__webgpu_sys__gen_GpuDeviceLostInfo__GpuDeviceLostInfo______true_: (a: number, b: number, c: any) => void;
48
- export const wasm_bindgen_8cf186fa7724d16d___convert__closures_____invoke___wgpu_54917290532eaf6b___backend__webgpu__webgpu_sys__gen_GpuDeviceLostInfo__GpuDeviceLostInfo______true__37: (a: number, b: number, c: any) => void;
50
+ export const wasm_bindgen_8cf186fa7724d16d___convert__closures_____invoke___wgpu_54917290532eaf6b___backend__webgpu__webgpu_sys__gen_GpuDeviceLostInfo__GpuDeviceLostInfo______true__39: (a: number, b: number, c: any) => void;
49
51
  export const __wbindgen_malloc: (a: number, b: number) => number;
50
52
  export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
51
53
  export const __wbindgen_exn_store: (a: number) => void;
@@ -66,6 +66,11 @@ export class WasmModel {
66
66
  * model. Sessions start over at their next call.
67
67
  */
68
68
  applyAdapter(lora: JsSource, options_json: string): Promise<any>;
69
+ /**
70
+ * Answers a conversation with images or videos in the default
71
+ * session; see [`WasmSession::chat_with_media`].
72
+ */
73
+ chatWithMedia(messages_json: string, options_json: string, media_json: string, media_data: Uint8Array, on_delta: Function, on_prefill?: Function | null): Promise<any>;
69
74
  /**
70
75
  * Answers a conversation in the default session; see
71
76
  * [`WasmSession::chat`].
@@ -93,7 +98,9 @@ export class WasmModel {
93
98
  * `{ format?: "q8" | "q4" | "q4_0" | "f32" | "f16" | "bf16",
94
99
  * contextLength?: number, deterministic?: boolean,
95
100
  * activations?: "quantized" | "f32", device?: "cpu" | "webgpu" | "auto",
96
- * adapterScale?: number, adapterMode?: "unmerged" | "merged" }`.
101
+ * adapterScale?: number, adapterMode?: "unmerged" | "merged",
102
+ * vision?: boolean }` (`vision: false` skips the vision encoder of a
103
+ * vision-language checkpoint).
97
104
  *
98
105
  * `device` defaults to `"cpu"`. `"auto"` picks WebGPU when an adapter
99
106
  * is available and the model has more than
@@ -112,6 +119,12 @@ export class WasmModel {
112
119
  * weights: a valid stored file serves them instead of converting the
113
120
  * checkpoint, else they are written to it as they are converted;
114
121
  * `info().weightCache` says which (see [`WeightCacheOutcome`]).
122
+ *
123
+ * `ggufFile` loads that GGUF file of the source (a source listing
124
+ * GGUF files and no safetensors loads its preferred one). Without
125
+ * `format`, a pre-quantized checkpoint (a `Q8_0` GGUF file, a
126
+ * `webslm export` checkpoint) loads in its own format, its blocks
127
+ * unchanged; weights already in the load format skip `weightCache`.
115
128
  */
116
129
  static load(source: JsSource, options_json: string, lora?: JsSource | null, weight_cache?: JsWeightCache | null): Promise<WasmModel>;
117
130
  /**
@@ -144,6 +157,16 @@ export class WasmSession {
144
157
  private constructor();
145
158
  free(): void;
146
159
  [Symbol.dispose](): void;
160
+ /**
161
+ * Answers a conversation whose messages hold image or video parts
162
+ * (`{"type": "image"}`, `{"type": "video"}`), with a vision-language
163
+ * model. `media_json` describes the images and videos, one per part in
164
+ * order, and `media_data` holds their RGBA pixels back to back (see
165
+ * `webslm_bindings::media`); the `media` generation option sets the
166
+ * video sampling (`maxFrames`, `fps`) and processor settings. Same
167
+ * callbacks and result as [`WasmSession::chat`].
168
+ */
169
+ chatWithMedia(messages_json: string, options_json: string, media_json: string, media_data: Uint8Array, on_delta: Function, on_prefill?: Function | null): Promise<any>;
147
170
  /**
148
171
  * Answers a conversation: `messages_json` is a JSON array of
149
172
  * `{ role, content }`, `options_json` a JSON object of generation
@@ -308,6 +331,7 @@ export interface InitOutput {
308
331
  readonly version: () => [number, number];
309
332
  readonly wasmmodel_applyAdapter: (a: number, b: number, c: number, d: number) => any;
310
333
  readonly wasmmodel_chat: (a: number, b: number, c: number, d: number, e: number, f: any, g: number) => any;
334
+ readonly 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;
311
335
  readonly wasmmodel_createSession: (a: number) => [number, number, number];
312
336
  readonly wasmmodel_detokenize: (a: number, b: number, c: number, d: number) => [number, number, number, number];
313
337
  readonly wasmmodel_generate: (a: number, b: number, c: number, d: number, e: number, f: any, g: number) => any;
@@ -319,6 +343,7 @@ export interface InitOutput {
319
343
  readonly wasmmodel_tokenize: (a: number, b: number, c: number, d: number) => [number, number, number, number];
320
344
  readonly wasmsession_capacity: (a: number) => [number, number, number];
321
345
  readonly wasmsession_chat: (a: number, b: number, c: number, d: number, e: number, f: any, g: number) => any;
346
+ readonly wasmsession_chatWithMedia: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: any, k: number) => any;
322
347
  readonly wasmsession_computed: (a: number) => [number, number, number];
323
348
  readonly wasmsession_fork: (a: number) => [number, number, number];
324
349
  readonly wasmsession_generate: (a: number, b: number, c: number, d: number, e: number, f: any, g: number) => any;
@@ -337,12 +362,12 @@ export interface InitOutput {
337
362
  readonly 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;
338
363
  readonly 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];
339
364
  readonly 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];
340
- readonly 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__46: (a: number, b: number, c: any) => [number, number];
341
- readonly 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__47: (a: number, b: number, c: any) => [number, number];
365
+ readonly 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];
366
+ readonly 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];
342
367
  readonly wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___js_sys_b608be85a12bc1d0___futures__task__wait_async_polyfill__MessageEvent______true_: (a: number, b: number, c: any) => void;
343
368
  readonly wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true_: (a: number, b: number, c: any) => void;
344
- readonly wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true__44: (a: number, b: number, c: any) => void;
345
- readonly wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true__45: (a: number, b: number, c: any) => void;
369
+ readonly wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true__46: (a: number, b: number, c: any) => void;
370
+ readonly wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true__47: (a: number, b: number, c: any) => void;
346
371
  readonly memory: WebAssembly.Memory;
347
372
  readonly __wbindgen_malloc: (a: number, b: number) => number;
348
373
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
@@ -159,6 +159,29 @@ export class WasmModel {
159
159
  const ret = wasm.wasmmodel_applyAdapter(this.__wbg_ptr, ptr0, ptr1, len1);
160
160
  return ret;
161
161
  }
162
+ /**
163
+ * Answers a conversation with images or videos in the default
164
+ * session; see [`WasmSession::chat_with_media`].
165
+ * @param {string} messages_json
166
+ * @param {string} options_json
167
+ * @param {string} media_json
168
+ * @param {Uint8Array} media_data
169
+ * @param {Function} on_delta
170
+ * @param {Function | null} [on_prefill]
171
+ * @returns {Promise<any>}
172
+ */
173
+ chatWithMedia(messages_json, options_json, media_json, media_data, on_delta, on_prefill) {
174
+ const ptr0 = passStringToWasm0(messages_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
175
+ const len0 = WASM_VECTOR_LEN;
176
+ const ptr1 = passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
177
+ const len1 = WASM_VECTOR_LEN;
178
+ const ptr2 = passStringToWasm0(media_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
179
+ const len2 = WASM_VECTOR_LEN;
180
+ const ptr3 = passArray8ToWasm0(media_data, wasm.__wbindgen_malloc);
181
+ const len3 = WASM_VECTOR_LEN;
182
+ const ret = wasm.wasmmodel_chatWithMedia(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, on_delta, isLikeNone(on_prefill) ? 0 : addToExternrefTable0(on_prefill));
183
+ return ret;
184
+ }
162
185
  /**
163
186
  * Answers a conversation in the default session; see
164
187
  * [`WasmSession::chat`].
@@ -246,7 +269,9 @@ export class WasmModel {
246
269
  * `{ format?: "q8" | "q4" | "q4_0" | "f32" | "f16" | "bf16",
247
270
  * contextLength?: number, deterministic?: boolean,
248
271
  * activations?: "quantized" | "f32", device?: "cpu" | "webgpu" | "auto",
249
- * adapterScale?: number, adapterMode?: "unmerged" | "merged" }`.
272
+ * adapterScale?: number, adapterMode?: "unmerged" | "merged",
273
+ * vision?: boolean }` (`vision: false` skips the vision encoder of a
274
+ * vision-language checkpoint).
250
275
  *
251
276
  * `device` defaults to `"cpu"`. `"auto"` picks WebGPU when an adapter
252
277
  * is available and the model has more than
@@ -265,6 +290,12 @@ export class WasmModel {
265
290
  * weights: a valid stored file serves them instead of converting the
266
291
  * checkpoint, else they are written to it as they are converted;
267
292
  * `info().weightCache` says which (see [`WeightCacheOutcome`]).
293
+ *
294
+ * `ggufFile` loads that GGUF file of the source (a source listing
295
+ * GGUF files and no safetensors loads its preferred one). Without
296
+ * `format`, a pre-quantized checkpoint (a `Q8_0` GGUF file, a
297
+ * `webslm export` checkpoint) loads in its own format, its blocks
298
+ * unchanged; weights already in the load format skip `weightCache`.
268
299
  * @param {JsSource} source
269
300
  * @param {string} options_json
270
301
  * @param {JsSource | null} [lora]
@@ -390,6 +421,34 @@ export class WasmSession {
390
421
  }
391
422
  return ret[0] >>> 0;
392
423
  }
424
+ /**
425
+ * Answers a conversation whose messages hold image or video parts
426
+ * (`{"type": "image"}`, `{"type": "video"}`), with a vision-language
427
+ * model. `media_json` describes the images and videos, one per part in
428
+ * order, and `media_data` holds their RGBA pixels back to back (see
429
+ * `webslm_bindings::media`); the `media` generation option sets the
430
+ * video sampling (`maxFrames`, `fps`) and processor settings. Same
431
+ * callbacks and result as [`WasmSession::chat`].
432
+ * @param {string} messages_json
433
+ * @param {string} options_json
434
+ * @param {string} media_json
435
+ * @param {Uint8Array} media_data
436
+ * @param {Function} on_delta
437
+ * @param {Function | null} [on_prefill]
438
+ * @returns {Promise<any>}
439
+ */
440
+ chatWithMedia(messages_json, options_json, media_json, media_data, on_delta, on_prefill) {
441
+ const ptr0 = passStringToWasm0(messages_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
442
+ const len0 = WASM_VECTOR_LEN;
443
+ const ptr1 = passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
444
+ const len1 = WASM_VECTOR_LEN;
445
+ const ptr2 = passStringToWasm0(media_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
446
+ const len2 = WASM_VECTOR_LEN;
447
+ const ptr3 = passArray8ToWasm0(media_data, wasm.__wbindgen_malloc);
448
+ const len3 = WASM_VECTOR_LEN;
449
+ const ret = wasm.wasmsession_chatWithMedia(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, on_delta, isLikeNone(on_prefill) ? 0 : addToExternrefTable0(on_prefill));
450
+ return ret;
451
+ }
393
452
  /**
394
453
  * Answers a conversation: `messages_json` is a JSON array of
395
454
  * `{ role, content }`, `options_json` a JSON object of generation
@@ -1584,43 +1643,43 @@ function __wbg_get_imports(memory) {
1584
1643
  arg0.writeBuffer(arg1, arg2, getArrayU8FromWasm0(arg3, arg4), arg5, arg6);
1585
1644
  }, arguments); },
1586
1645
  __wbindgen_generic_0000000000000001: function(arg0, arg1) {
1587
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 365, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1646
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 391, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1588
1647
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true_);
1589
1648
  return ret;
1590
1649
  },
1591
1650
  __wbindgen_generic_0000000000000002: function(arg0, arg1) {
1592
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 888, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1651
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 931, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1593
1652
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue__core_2b10d7c4e784534e___result__Result_____wasm_bindgen_3c612a990bfab728___JsError___true_);
1594
1653
  return ret;
1595
1654
  },
1596
1655
  __wbindgen_generic_0000000000000003: function(arg0, arg1) {
1597
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 890, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1656
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 933, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1598
1657
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___js_sys_b608be85a12bc1d0___futures__task__wait_async_polyfill__MessageEvent______true_);
1599
1658
  return ret;
1600
1659
  },
1601
1660
  __wbindgen_generic_0000000000000004: function(arg0, arg1) {
1602
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUDevice")], shim_idx: 363, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1661
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUDevice")], shim_idx: 389, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1603
1662
  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_);
1604
1663
  return ret;
1605
1664
  },
1606
1665
  __wbindgen_generic_0000000000000005: function(arg0, arg1) {
1607
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUDeviceLostInfo")], shim_idx: 365, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1608
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true__44);
1666
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUDeviceLostInfo")], shim_idx: 391, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1667
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true__46);
1609
1668
  return ret;
1610
1669
  },
1611
1670
  __wbindgen_generic_0000000000000006: function(arg0, arg1) {
1612
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUUncapturedErrorEvent")], shim_idx: 365, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1613
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true__45);
1671
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUUncapturedErrorEvent")], shim_idx: 391, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1672
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true__47);
1614
1673
  return ret;
1615
1674
  },
1616
1675
  __wbindgen_generic_0000000000000007: function(arg0, arg1) {
1617
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("any")], shim_idx: 363, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1618
- 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__46);
1676
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("any")], shim_idx: 389, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1677
+ 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);
1619
1678
  return ret;
1620
1679
  },
1621
1680
  __wbindgen_generic_0000000000000008: function(arg0, arg1) {
1622
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("undefined")], shim_idx: 363, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1623
- 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__47);
1681
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("undefined")], shim_idx: 389, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1682
+ 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);
1624
1683
  return ret;
1625
1684
  },
1626
1685
  __wbindgen_generic_0000000000000009: function(arg0) {
@@ -1682,12 +1741,12 @@ function wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___js_sys_b
1682
1741
  wasm.wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___js_sys_b608be85a12bc1d0___futures__task__wait_async_polyfill__MessageEvent______true_(arg0, arg1, arg2);
1683
1742
  }
1684
1743
 
1685
- function wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true__44(arg0, arg1, arg2) {
1686
- wasm.wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true__44(arg0, arg1, arg2);
1744
+ function wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true__46(arg0, arg1, arg2) {
1745
+ wasm.wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true__46(arg0, arg1, arg2);
1687
1746
  }
1688
1747
 
1689
- function wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true__45(arg0, arg1, arg2) {
1690
- wasm.wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true__45(arg0, arg1, arg2);
1748
+ function wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true__47(arg0, arg1, arg2) {
1749
+ wasm.wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true__47(arg0, arg1, arg2);
1691
1750
  }
1692
1751
 
1693
1752
  function wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue__core_2b10d7c4e784534e___result__Result_____wasm_bindgen_3c612a990bfab728___JsError___true_(arg0, arg1, arg2) {
@@ -1704,15 +1763,15 @@ function wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bin
1704
1763
  }
1705
1764
  }
1706
1765
 
1707
- 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__46(arg0, arg1, arg2) {
1708
- 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__46(arg0, arg1, arg2);
1766
+ 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) {
1767
+ 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);
1709
1768
  if (ret[1]) {
1710
1769
  throw takeFromExternrefTable0(ret[0]);
1711
1770
  }
1712
1771
  }
1713
1772
 
1714
- 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__47(arg0, arg1, arg2) {
1715
- 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__47(arg0, arg1, arg2);
1773
+ 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) {
1774
+ 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);
1716
1775
  if (ret[1]) {
1717
1776
  throw takeFromExternrefTable0(ret[0]);
1718
1777
  }
Binary file
@@ -19,6 +19,7 @@ export const supportedModelTypes: () => [number, number];
19
19
  export const version: () => [number, number];
20
20
  export const wasmmodel_applyAdapter: (a: number, b: number, c: number, d: number) => any;
21
21
  export const wasmmodel_chat: (a: number, b: number, c: number, d: number, e: number, f: any, g: number) => any;
22
+ 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;
22
23
  export const wasmmodel_createSession: (a: number) => [number, number, number];
23
24
  export const wasmmodel_detokenize: (a: number, b: number, c: number, d: number) => [number, number, number, number];
24
25
  export const wasmmodel_generate: (a: number, b: number, c: number, d: number, e: number, f: any, g: number) => any;
@@ -30,6 +31,7 @@ export const wasmmodel_reset: (a: number) => [number, number];
30
31
  export const wasmmodel_tokenize: (a: number, b: number, c: number, d: number) => [number, number, number, number];
31
32
  export const wasmsession_capacity: (a: number) => [number, number, number];
32
33
  export const wasmsession_chat: (a: number, b: number, c: number, d: number, e: number, f: any, g: number) => any;
34
+ export const wasmsession_chatWithMedia: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: any, k: number) => any;
33
35
  export const wasmsession_computed: (a: number) => [number, number, number];
34
36
  export const wasmsession_fork: (a: number) => [number, number, number];
35
37
  export const wasmsession_generate: (a: number, b: number, c: number, d: number, e: number, f: any, g: number) => any;
@@ -48,12 +50,12 @@ export const wbg_rayon_start_worker: (a: number) => void;
48
50
  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;
49
51
  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];
50
52
  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];
51
- 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__46: (a: number, b: number, c: any) => [number, number];
52
- 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__47: (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];
53
55
  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;
54
56
  export const wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true_: (a: number, b: number, c: any) => void;
55
- export const wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true__44: (a: number, b: number, c: any) => void;
56
- export const wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true__45: (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;
57
59
  export const memory: WebAssembly.Memory;
58
60
  export const __wbindgen_malloc: (a: number, b: number) => number;
59
61
  export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;