elazarg / nakdimon

Hebrew Diacritizer
https://nakdimon.org
MIT License
31 stars 7 forks source link

Cache model in the website #29

Open thewh1teagle opened 3 months ago

thewh1teagle commented 3 months ago

The website nakdimon.org reloads the model each time I open it. Could you implement caching for the model to avoid this?

Also, it might be more lightweight and faster to run it using onnxruntime, which has an npm package available.

elazarg commented 3 months ago

I trust the default cache implemented in the browser; on my machine it is only downloaded once. Did you disable cache by any chance? image

thewh1teagle commented 3 months ago

I trust the default cache implemented in the browser; on my machine it is only downloaded once. Did you disable cache by any chance?

Interesting. I don't know if something changed but suddenly It does load it from cache. though, multiple times today it was stuck on loading, and just before create the issue I checked and it was load the model... I'll check later again to see if it happens again

elazarg commented 3 months ago

Regarding onnx, we need something like this example: https://github.com/microsoft/onnxruntime-inference-examples/blob/main/js/quick-start_onnxruntime-web-script-tag/index.html

thewh1teagle commented 3 months ago

It loaded again the model today (and every few hours) Seems like it cache the model only for 4 hours.

elazarg commented 3 months ago

I have updated the browser cache TTL to 8 days.

thewh1teagle commented 2 months ago

I can see that it's updated. Thanks!