diff --git a/README.ja.md b/README.ja.md index 5e92fe0b..be81b36f 100644 --- a/README.ja.md +++ b/README.ja.md @@ -57,6 +57,7 @@ console.log(outputTensor.data); // Float32Array テスト対象のONNXモデルおよび、入出力テンソルの生成 ``` +pip install -r requirements.test.txt python test/model_test/make_models.py ``` diff --git a/README.md b/README.md index ce040ebe..ce4a1ca3 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,7 @@ See `example/minimum` for the complete minimal code that works. Generate ONNX models and input/output tensors to be tested ``` +pip install -r requirements.test.txt python test/model_test/make_models.py ``` diff --git a/requirements.test.txt b/requirements.test.txt new file mode 100644 index 00000000..538051c0 --- /dev/null +++ b/requirements.test.txt @@ -0,0 +1,4 @@ +onnx +onnxruntime +torch +torchvision diff --git a/src/shader/wasm/compile.py b/src/shader/wasm/compile.py index 1ddface1..b4c3a8bf 100644 --- a/src/shader/wasm/compile.py +++ b/src/shader/wasm/compile.py @@ -37,7 +37,7 @@ worker_js = f.read() worker_js_with_wasm = worker_js.replace("WASM_WORKER_WASM_BINARY_BASE64", base64.b64encode(worker_wasm).decode("ascii")) -worker_js_with_wasm_escaped = worker_js_with_wasm.replace("\\", "\\\\").replace("`", "\\`") +worker_js_with_wasm_escaped = worker_js_with_wasm.replace("\\", "\\\\").replace("`", "\\`").replace("$", "\\$") worker_data_url_src = f"""/* eslint-disable */ export const wasmWorkerSrcUrl = URL.createObjectURL(new File([`{worker_js_with_wasm_escaped}`], "worker.js", {{type: "text/javascript"}}));