fix: wasm webgl

This commit is contained in:
Googlefan
2024-09-30 10:35:37 +00:00
parent 596eec654d
commit 65303173a8
2 changed files with 5 additions and 9 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "sbv2",
"version": "0.1.0",
"version": "0.1.1",
"description": "Style Bert VITS2 wasm",
"main": "dist/index.js",
"types": "dist/index.d.ts",
@@ -21,9 +21,5 @@
"dependencies": {
"onnxruntime-web": "^1.19.2"
},
"files": [
"dist/*",
"package.json",
"README.md"
]
"files": ["dist/*", "package.json", "README.md"]
}

View File

@@ -13,9 +13,9 @@ export class ModelHolder {
}
public static async create(tok: string, deberta: ArrayBufferLike) {
return new ModelHolder(
await wasm.load_tokenizer(tok),
wasm.load_tokenizer(tok),
await InferenceSession.create(deberta, {
executionProviders: ["webnn", "webgpu", "webgl", "wasm", "cpu"],
executionProviders: ["webnn", "webgpu", "wasm", "cpu"],
graphOptimizationLevel: "all",
}),
);
@@ -92,7 +92,7 @@ export class ModelHolder {
public async load(name: string, b: Uint8Array) {
const [style, vits2_b] = wasm.load_sbv2file(b);
const vits2 = await InferenceSession.create(vits2_b as Uint8Array, {
executionProviders: ["webnn", "webgpu", "webgl", "wasm", "cpu"],
executionProviders: ["webnn", "webgpu", "wasm", "cpu"],
graphOptimizationLevel: "all",
});
this.models.set(name, [vits2, style]);