webslm 0.10.0 → 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.
- package/README.md +32 -1
- package/dist/client.d.ts +3 -0
- package/dist/client.js +3 -0
- package/dist/engine.js +57 -0
- package/dist/index.d.ts +1 -0
- package/dist/models.d.ts +27 -0
- package/dist/models.js +57 -0
- package/dist/native.d.ts +14 -0
- package/dist/protocol.d.ts +14 -0
- package/dist/train.d.ts +201 -0
- package/dist/train.js +99 -0
- package/native-manifest.json +29 -29
- package/package.json +1 -1
- package/wasm/relaxed/webslm_wasm.d.ts +58 -3
- package/wasm/relaxed/webslm_wasm.js +162 -15
- package/wasm/relaxed/webslm_wasm_bg.wasm +0 -0
- package/wasm/relaxed/webslm_wasm_bg.wasm.d.ts +11 -3
- package/wasm/simd/webslm_wasm.d.ts +58 -3
- package/wasm/simd/webslm_wasm.js +162 -15
- package/wasm/simd/webslm_wasm_bg.wasm +0 -0
- package/wasm/simd/webslm_wasm_bg.wasm.d.ts +11 -3
- package/wasm/threads/webslm_wasm.d.ts +59 -4
- package/wasm/threads/webslm_wasm.js +174 -27
- package/wasm/threads/webslm_wasm_bg.wasm +0 -0
- package/wasm/threads/webslm_wasm_bg.wasm.d.ts +12 -4
|
@@ -780,6 +780,135 @@ export class WasmSession {
|
|
|
780
780
|
}
|
|
781
781
|
if (Symbol.dispose) WasmSession.prototype[Symbol.dispose] = WasmSession.prototype.free;
|
|
782
782
|
|
|
783
|
+
/**
|
|
784
|
+
* A model being trained.
|
|
785
|
+
*/
|
|
786
|
+
export class WasmTrainer {
|
|
787
|
+
static __wrap(ptr) {
|
|
788
|
+
const obj = Object.create(WasmTrainer.prototype);
|
|
789
|
+
obj.__wbg_ptr = ptr;
|
|
790
|
+
WasmTrainerFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
791
|
+
return obj;
|
|
792
|
+
}
|
|
793
|
+
__destroy_into_raw() {
|
|
794
|
+
const ptr = this.__wbg_ptr;
|
|
795
|
+
this.__wbg_ptr = 0;
|
|
796
|
+
WasmTrainerFinalization.unregister(this);
|
|
797
|
+
return ptr;
|
|
798
|
+
}
|
|
799
|
+
free() {
|
|
800
|
+
const ptr = this.__destroy_into_raw();
|
|
801
|
+
wasm.__wbg_wasmtrainer_free(ptr, 0);
|
|
802
|
+
}
|
|
803
|
+
/**
|
|
804
|
+
* Adds a sequence to group `group`: `teacher` is `"none"`, `"base"`,
|
|
805
|
+
* `"topk"` (`k` ids and probabilities per prediction) or `"logits"`.
|
|
806
|
+
* @param {number} group
|
|
807
|
+
* @param {Uint32Array} ids
|
|
808
|
+
* @param {Float32Array | null | undefined} weights
|
|
809
|
+
* @param {string} teacher
|
|
810
|
+
* @param {number} k
|
|
811
|
+
* @param {Uint32Array | null} [teacher_ids]
|
|
812
|
+
* @param {Float32Array | null} [teacher_values]
|
|
813
|
+
*/
|
|
814
|
+
addExample(group, ids, weights, teacher, k, teacher_ids, teacher_values) {
|
|
815
|
+
const ptr0 = passArray32ToWasm0(ids, wasm.__wbindgen_malloc);
|
|
816
|
+
const len0 = WASM_VECTOR_LEN;
|
|
817
|
+
var ptr1 = isLikeNone(weights) ? 0 : passArrayF32ToWasm0(weights, wasm.__wbindgen_malloc);
|
|
818
|
+
var len1 = WASM_VECTOR_LEN;
|
|
819
|
+
const ptr2 = passStringToWasm0(teacher, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
820
|
+
const len2 = WASM_VECTOR_LEN;
|
|
821
|
+
var ptr3 = isLikeNone(teacher_ids) ? 0 : passArray32ToWasm0(teacher_ids, wasm.__wbindgen_malloc);
|
|
822
|
+
var len3 = WASM_VECTOR_LEN;
|
|
823
|
+
var ptr4 = isLikeNone(teacher_values) ? 0 : passArrayF32ToWasm0(teacher_values, wasm.__wbindgen_malloc);
|
|
824
|
+
var len4 = WASM_VECTOR_LEN;
|
|
825
|
+
const ret = wasm.wasmtrainer_addExample(this.__wbg_ptr, group, ptr0, len0, ptr1, len1, ptr2, len2, k, ptr3, len3, ptr4, len4);
|
|
826
|
+
if (ret[1]) {
|
|
827
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
/**
|
|
831
|
+
* Adds a data group (`TrainGroupJs`: `{ batchSize?, weight?, ce?,
|
|
832
|
+
* kl?, reduction?, sampling?, sampleWeights? }`); returns its index.
|
|
833
|
+
* Groups take effect at [`WasmTrainer::commit`].
|
|
834
|
+
* @param {string} group_json
|
|
835
|
+
* @returns {number}
|
|
836
|
+
*/
|
|
837
|
+
addGroup(group_json) {
|
|
838
|
+
const ptr0 = passStringToWasm0(group_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
839
|
+
const len0 = WASM_VECTOR_LEN;
|
|
840
|
+
const ret = wasm.wasmtrainer_addGroup(this.__wbg_ptr, ptr0, len0);
|
|
841
|
+
if (ret[2]) {
|
|
842
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
843
|
+
}
|
|
844
|
+
return ret[0] >>> 0;
|
|
845
|
+
}
|
|
846
|
+
/**
|
|
847
|
+
* Sets the groups added so far as the data steps draw from (replacing
|
|
848
|
+
* earlier ones).
|
|
849
|
+
*/
|
|
850
|
+
commit() {
|
|
851
|
+
const ret = wasm.wasmtrainer_commit(this.__wbg_ptr);
|
|
852
|
+
if (ret[1]) {
|
|
853
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
/**
|
|
857
|
+
* The trained delta as files, `{ [name]: Uint8Array }`: `format`
|
|
858
|
+
* `"peft"` (default: `adapter_config.json` and
|
|
859
|
+
* `adapter_model.safetensors`) or `"dense"` (`delta.safetensors`).
|
|
860
|
+
* `base_model` fills `base_model_name_or_path`.
|
|
861
|
+
* @param {string | null} [format]
|
|
862
|
+
* @param {string | null} [base_model]
|
|
863
|
+
* @returns {Promise<any>}
|
|
864
|
+
*/
|
|
865
|
+
files(format, base_model) {
|
|
866
|
+
var ptr0 = isLikeNone(format) ? 0 : passStringToWasm0(format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
867
|
+
var len0 = WASM_VECTOR_LEN;
|
|
868
|
+
var ptr1 = isLikeNone(base_model) ? 0 : passStringToWasm0(base_model, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
869
|
+
var len1 = WASM_VECTOR_LEN;
|
|
870
|
+
const ret = wasm.wasmtrainer_files(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
871
|
+
return ret;
|
|
872
|
+
}
|
|
873
|
+
/**
|
|
874
|
+
* Describes the trainer (see `TrainerInfo`).
|
|
875
|
+
* @returns {any}
|
|
876
|
+
*/
|
|
877
|
+
info() {
|
|
878
|
+
const ret = wasm.wasmtrainer_info(this.__wbg_ptr);
|
|
879
|
+
if (ret[2]) {
|
|
880
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
881
|
+
}
|
|
882
|
+
return takeFromExternrefTable0(ret[0]);
|
|
883
|
+
}
|
|
884
|
+
/**
|
|
885
|
+
* Loads the model of `source` for training. `options_json`: see
|
|
886
|
+
* `TrainOptionsJs` (`{ steps, method?, rank?, alpha?, targets?,
|
|
887
|
+
* layers?, lr?, ..., device? }`).
|
|
888
|
+
* @param {JsSource} source
|
|
889
|
+
* @param {string} options_json
|
|
890
|
+
* @returns {Promise<WasmTrainer>}
|
|
891
|
+
*/
|
|
892
|
+
static load(source, options_json) {
|
|
893
|
+
_assertClass(source, JsSource);
|
|
894
|
+
var ptr0 = source.__destroy_into_raw();
|
|
895
|
+
const ptr1 = passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
896
|
+
const len1 = WASM_VECTOR_LEN;
|
|
897
|
+
const ret = wasm.wasmtrainer_load(ptr0, ptr1, len1);
|
|
898
|
+
return ret;
|
|
899
|
+
}
|
|
900
|
+
/**
|
|
901
|
+
* Runs one optimizer step; resolves to `{ step, lr, loss,
|
|
902
|
+
* groupLosses, tokens, clamped, timeMs }`.
|
|
903
|
+
* @returns {Promise<any>}
|
|
904
|
+
*/
|
|
905
|
+
step() {
|
|
906
|
+
const ret = wasm.wasmtrainer_step(this.__wbg_ptr);
|
|
907
|
+
return ret;
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
if (Symbol.dispose) WasmTrainer.prototype[Symbol.dispose] = WasmTrainer.prototype.free;
|
|
911
|
+
|
|
783
912
|
/**
|
|
784
913
|
* How this module was built: `{ flavour, kernels, threads }`. `flavour`
|
|
785
914
|
* is `"simd"`, `"relaxed"` (SIMD128 and relaxed SIMD) or `"threads"`
|
|
@@ -1495,6 +1624,10 @@ function __wbg_get_imports(memory) {
|
|
|
1495
1624
|
const ret = new Worker(getStringFromWasm0(arg0, arg1));
|
|
1496
1625
|
return ret;
|
|
1497
1626
|
},
|
|
1627
|
+
__wbg_now_d1fb6650485d7f3e: function() {
|
|
1628
|
+
const ret = Date.now();
|
|
1629
|
+
return ret;
|
|
1630
|
+
},
|
|
1498
1631
|
__wbg_of_d9a05aa72bb023a2: function(arg0, arg1, arg2) {
|
|
1499
1632
|
const ret = Array.of(arg0, arg1, arg2);
|
|
1500
1633
|
return ret;
|
|
@@ -1842,47 +1975,51 @@ function __wbg_get_imports(memory) {
|
|
|
1842
1975
|
const ret = WasmModel.__wrap(arg0);
|
|
1843
1976
|
return ret;
|
|
1844
1977
|
},
|
|
1978
|
+
__wbg_wasmtrainer_new: function(arg0) {
|
|
1979
|
+
const ret = WasmTrainer.__wrap(arg0);
|
|
1980
|
+
return ret;
|
|
1981
|
+
},
|
|
1845
1982
|
__wbg_writeBuffer_badef58fae6c9543: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6) {
|
|
1846
1983
|
arg0.writeBuffer(arg1, arg2, getArrayU8FromWasm0(arg3, arg4), arg5, arg6);
|
|
1847
1984
|
}, arguments); },
|
|
1848
1985
|
__wbindgen_generic_0000000000000001: function(arg0, arg1) {
|
|
1849
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
1850
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1986
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 1026, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
1987
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue__core_2b10d7c4e784534e___result__Result_____wasm_bindgen_3c612a990bfab728___JsError___true_);
|
|
1851
1988
|
return ret;
|
|
1852
1989
|
},
|
|
1853
1990
|
__wbindgen_generic_0000000000000002: function(arg0, arg1) {
|
|
1854
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
1855
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1991
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 1028, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1992
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___js_sys_b608be85a12bc1d0___futures__task__wait_async_polyfill__MessageEvent______true_);
|
|
1856
1993
|
return ret;
|
|
1857
1994
|
},
|
|
1858
1995
|
__wbindgen_generic_0000000000000003: function(arg0, arg1) {
|
|
1859
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
1860
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1996
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 474, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1997
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true_);
|
|
1861
1998
|
return ret;
|
|
1862
1999
|
},
|
|
1863
2000
|
__wbindgen_generic_0000000000000004: function(arg0, arg1) {
|
|
1864
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUDevice")], shim_idx:
|
|
2001
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUDevice")], shim_idx: 472, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
1865
2002
|
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_);
|
|
1866
2003
|
return ret;
|
|
1867
2004
|
},
|
|
1868
2005
|
__wbindgen_generic_0000000000000005: function(arg0, arg1) {
|
|
1869
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUDeviceLostInfo")], shim_idx:
|
|
1870
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2006
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUDeviceLostInfo")], shim_idx: 474, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2007
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true__62);
|
|
1871
2008
|
return ret;
|
|
1872
2009
|
},
|
|
1873
2010
|
__wbindgen_generic_0000000000000006: function(arg0, arg1) {
|
|
1874
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUUncapturedErrorEvent")], shim_idx:
|
|
1875
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2011
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUUncapturedErrorEvent")], shim_idx: 474, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2012
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true__63);
|
|
1876
2013
|
return ret;
|
|
1877
2014
|
},
|
|
1878
2015
|
__wbindgen_generic_0000000000000007: function(arg0, arg1) {
|
|
1879
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("any")], shim_idx:
|
|
1880
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2016
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("any")], shim_idx: 472, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
2017
|
+
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__64);
|
|
1881
2018
|
return ret;
|
|
1882
2019
|
},
|
|
1883
2020
|
__wbindgen_generic_0000000000000008: function(arg0, arg1) {
|
|
1884
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("undefined")], shim_idx:
|
|
1885
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2021
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("undefined")], shim_idx: 472, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
2022
|
+
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__65);
|
|
1886
2023
|
return ret;
|
|
1887
2024
|
},
|
|
1888
2025
|
__wbindgen_generic_0000000000000009: function(arg0) {
|
|
@@ -1936,20 +2073,20 @@ function __wbg_get_imports(memory) {
|
|
|
1936
2073
|
};
|
|
1937
2074
|
}
|
|
1938
2075
|
|
|
1939
|
-
function wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true_(arg0, arg1, arg2) {
|
|
1940
|
-
wasm.wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true_(arg0, arg1, arg2);
|
|
1941
|
-
}
|
|
1942
|
-
|
|
1943
2076
|
function wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___js_sys_b608be85a12bc1d0___futures__task__wait_async_polyfill__MessageEvent______true_(arg0, arg1, arg2) {
|
|
1944
2077
|
wasm.wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___js_sys_b608be85a12bc1d0___futures__task__wait_async_polyfill__MessageEvent______true_(arg0, arg1, arg2);
|
|
1945
2078
|
}
|
|
1946
2079
|
|
|
1947
|
-
function
|
|
1948
|
-
wasm.
|
|
2080
|
+
function wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true_(arg0, arg1, arg2) {
|
|
2081
|
+
wasm.wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true_(arg0, arg1, arg2);
|
|
2082
|
+
}
|
|
2083
|
+
|
|
2084
|
+
function wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true__62(arg0, arg1, arg2) {
|
|
2085
|
+
wasm.wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true__62(arg0, arg1, arg2);
|
|
1949
2086
|
}
|
|
1950
2087
|
|
|
1951
|
-
function
|
|
1952
|
-
wasm.
|
|
2088
|
+
function wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true__63(arg0, arg1, arg2) {
|
|
2089
|
+
wasm.wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true__63(arg0, arg1, arg2);
|
|
1953
2090
|
}
|
|
1954
2091
|
|
|
1955
2092
|
function wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue__core_2b10d7c4e784534e___result__Result_____wasm_bindgen_3c612a990bfab728___JsError___true_(arg0, arg1, arg2) {
|
|
@@ -1966,15 +2103,15 @@ function wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bin
|
|
|
1966
2103
|
}
|
|
1967
2104
|
}
|
|
1968
2105
|
|
|
1969
|
-
function
|
|
1970
|
-
const ret = wasm.
|
|
2106
|
+
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__64(arg0, arg1, arg2) {
|
|
2107
|
+
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__64(arg0, arg1, arg2);
|
|
1971
2108
|
if (ret[1]) {
|
|
1972
2109
|
throw takeFromExternrefTable0(ret[0]);
|
|
1973
2110
|
}
|
|
1974
2111
|
}
|
|
1975
2112
|
|
|
1976
|
-
function
|
|
1977
|
-
const ret = wasm.
|
|
2113
|
+
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__65(arg0, arg1, arg2) {
|
|
2114
|
+
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__65(arg0, arg1, arg2);
|
|
1978
2115
|
if (ret[1]) {
|
|
1979
2116
|
throw takeFromExternrefTable0(ret[0]);
|
|
1980
2117
|
}
|
|
@@ -2031,6 +2168,9 @@ const WasmModelFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
2031
2168
|
const WasmSessionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2032
2169
|
? { register: () => {}, unregister: () => {} }
|
|
2033
2170
|
: new FinalizationRegistry(ptr => wasm.__wbg_wasmsession_free(ptr, 1));
|
|
2171
|
+
const WasmTrainerFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2172
|
+
? { register: () => {}, unregister: () => {} }
|
|
2173
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmtrainer_free(ptr, 1));
|
|
2034
2174
|
const wbg_rayon_PoolBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2035
2175
|
? { register: () => {}, unregister: () => {} }
|
|
2036
2176
|
: new FinalizationRegistry(ptr => wasm.__wbg_wbg_rayon_poolbuilder_free(ptr, 1));
|
|
@@ -2243,6 +2383,13 @@ function passArray8ToWasm0(arg, malloc) {
|
|
|
2243
2383
|
return ptr;
|
|
2244
2384
|
}
|
|
2245
2385
|
|
|
2386
|
+
function passArrayF32ToWasm0(arg, malloc) {
|
|
2387
|
+
const ptr = malloc(arg.length * 4, 4) >>> 0;
|
|
2388
|
+
getFloat32ArrayMemory0().set(arg, ptr / 4);
|
|
2389
|
+
WASM_VECTOR_LEN = arg.length;
|
|
2390
|
+
return ptr;
|
|
2391
|
+
}
|
|
2392
|
+
|
|
2246
2393
|
function passStringToWasm0(arg, malloc, realloc) {
|
|
2247
2394
|
if (realloc === undefined) {
|
|
2248
2395
|
const buf = cachedTextEncoder.encode(arg);
|
|
Binary file
|
|
@@ -6,6 +6,7 @@ export const __wbg_sha256hasher_free: (a: number, b: number) => void;
|
|
|
6
6
|
export const __wbg_wasmimagemodel_free: (a: number, b: number) => void;
|
|
7
7
|
export const __wbg_wasmmodel_free: (a: number, b: number) => void;
|
|
8
8
|
export const __wbg_wasmsession_free: (a: number, b: number) => void;
|
|
9
|
+
export const __wbg_wasmtrainer_free: (a: number, b: number) => void;
|
|
9
10
|
export const __wbg_wbg_rayon_poolbuilder_free: (a: number, b: number) => void;
|
|
10
11
|
export const buildInfo: () => [number, number, number];
|
|
11
12
|
export const initThreadPool: (a: number) => any;
|
|
@@ -53,6 +54,13 @@ export const wasmsession_shiftContext: (a: number, b: number, c: number) => any;
|
|
|
53
54
|
export const wasmsession_step: (a: number, b: number, c: number, d: number) => any;
|
|
54
55
|
export const wasmsession_tokens: (a: number) => [number, number, number, number];
|
|
55
56
|
export const wasmsession_truncate: (a: number, b: number) => [number, number];
|
|
57
|
+
export const wasmtrainer_addExample: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number) => [number, number];
|
|
58
|
+
export const wasmtrainer_addGroup: (a: number, b: number, c: number) => [number, number, number];
|
|
59
|
+
export const wasmtrainer_commit: (a: number) => [number, number];
|
|
60
|
+
export const wasmtrainer_files: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
61
|
+
export const wasmtrainer_info: (a: number) => [number, number, number];
|
|
62
|
+
export const wasmtrainer_load: (a: number, b: number, c: number) => any;
|
|
63
|
+
export const wasmtrainer_step: (a: number) => any;
|
|
56
64
|
export const wbg_rayon_poolbuilder_build: (a: number) => void;
|
|
57
65
|
export const wbg_rayon_poolbuilder_numThreads: (a: number) => number;
|
|
58
66
|
export const wbg_rayon_poolbuilder_receiver: (a: number) => number;
|
|
@@ -60,12 +68,12 @@ export const wbg_rayon_start_worker: (a: number) => void;
|
|
|
60
68
|
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;
|
|
61
69
|
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];
|
|
62
70
|
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];
|
|
63
|
-
export const
|
|
64
|
-
export const
|
|
71
|
+
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__64: (a: number, b: number, c: any) => [number, number];
|
|
72
|
+
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__65: (a: number, b: number, c: any) => [number, number];
|
|
65
73
|
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;
|
|
66
74
|
export const wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true_: (a: number, b: number, c: any) => void;
|
|
67
|
-
export const
|
|
68
|
-
export const
|
|
75
|
+
export const wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true__62: (a: number, b: number, c: any) => void;
|
|
76
|
+
export const wasm_bindgen_3c612a990bfab728___convert__closures_____invoke___wasm_bindgen_3c612a990bfab728___JsValue______true__63: (a: number, b: number, c: any) => void;
|
|
69
77
|
export const memory: WebAssembly.Memory;
|
|
70
78
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
71
79
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|