# Onnx model takes longer to load when deployed on IC Network

**URL:** <https://forum.dfinity.org/t/onnx-model-takes-longer-to-load-when-deployed-on-ic-network/27627>\
**Category:** JavaScript\
**Created:** [February 16, 2024, 1:59pm UTC](https://forum.dfinity.org/t/onnx-model-takes-longer-to-load-when-deployed-on-ic-network/27627 "2024-02-16T13:59:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![galenoshea](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/galenoshea/32/15780_2.png) [@galenoshea](https://forum.dfinity.org/u/galenoshea)\
**Post date:** [February 16, 2024, 1:59pm UTC](https://forum.dfinity.org/t/onnx-model-takes-longer-to-load-when-deployed-on-ic-network/27627/1 "2024-02-16T13:59:49Z")

</div>

Hey I’m new to Internet Computer Dev. I recently deployed a web app which uses an onnx model the using onnxruntime module with webgl as the backend. It takes roughly 5 seconds to load locally but around 1 minute on the IC network.

I was wondering what optimizations I can do to optimize?

Also as a side note I can’t use wasm backend since I get these errors:

```auto
index.js:42338 wasm streaming compile failed: TypeError: Failed to execute 'compile' on 'WebAssembly': Incorrect response MIME type. Expected 'application/wasm'.

index.js:2 failed to asynchronously prepare wasm: CompileError: WebAssembly.instantiate(): expected magic word 00 61 73 6d, found 3c 21 64 6f @+0

```

---

<div class="post-metadata">

**Author:** ![peterparker](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@peterparker](https://forum.dfinity.org/u/peterparker)\
**Post date:** [February 16, 2024, 4:21pm UTC](https://forum.dfinity.org/t/onnx-model-takes-longer-to-load-when-deployed-on-ic-network/27627/2 "2024-02-16T16:21:25Z")

</div>

I don’t have the answer, but I’m really curious about the issue. Could you share the link to the dApp you’ve deployed? Is your project open-source?

---

<div class="post-metadata">

**Author:** ![peterparker](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@peterparker](https://forum.dfinity.org/u/peterparker)\
**Post date:** [February 16, 2024, 4:22pm UTC](https://forum.dfinity.org/t/onnx-model-takes-longer-to-load-when-deployed-on-ic-network/27627/3 "2024-02-16T16:22:43Z")

</div>

Found this similar issue on the forum, maybe related?

> [@How to solve "MIME type" errors in deployed canisters?](https://forum.dfinity.org/t/how-to-solve-mime-type-errors-in-deployed-canisters/22998/2):
>
> I’ve put in place this set of changes, helpfully recommended by AdamS in the ICP Developer Community Discord: You’ve set up your URLs wrong. The assets dir is not a component of your URLs. assets contains static data, and is served from the root, same as generated data does not have dist in the URL. And then you’ve set a script to be imported from /src , which isn’t included in the assets container at all, and which is superfluous; the bundler converts your JS code to a single file that’s al…
