elazarg / nakdimon

Hebrew Diacritizer
https://nakdimon.org
MIT License
27 stars 6 forks source link

Cache model in the website #29

Open thewh1teagle opened 2 weeks ago

thewh1teagle commented 2 weeks 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 2 weeks 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 2 weeks 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 2 weeks 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 2 weeks ago

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

elazarg commented 2 weeks ago

I have updated the browser cache TTL to 8 days.

thewh1teagle commented 1 week ago

I can see that it's updated. Thanks!