Skip to content

Instantly share code, notes, and snippets.

View phxtho's full-sized avatar

Phatho Pukwana phxtho

View GitHub Profile
@notwaldorf
notwaldorf / README.md
Last active June 7, 2023 00:21
ServiceWorker code to cache Tensorflow model shards.

ServiceWorker code to cache TensorFlow model shards.

One of the problems I have when testing giant TensorFlow models in TensorFlow.js is that they're huge (like 500 MB) and they take forever to download, every time I refresh the page. This is how I setup my ServiceWorker code so that at least in testing I only have to download the model once, and then it's saved in the cache for the next time.