Skip to content

Commit

Permalink
Merge pull request #969 from mil-tokyo/fix966
Browse files Browse the repository at this point in the history
Support latest Emscripten
  • Loading branch information
milhidaka authored Dec 1, 2024
2 parents 92c0a6c + 67aaac3 commit d15df8f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ console.log(outputTensor.data); // Float32Array
テスト対象のONNXモデルおよび、入出力テンソルの生成

```
pip install -r requirements.test.txt
python test/model_test/make_models.py
```

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down
4 changes: 4 additions & 0 deletions requirements.test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
onnx
onnxruntime
torch
torchvision
2 changes: 1 addition & 1 deletion src/shader/wasm/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"}}));
Expand Down

0 comments on commit d15df8f

Please sign in to comment.