Loading models from "non-URL" locations in the browser
Opened this issue · 0 comments
Question
Hi! I have an application where the model files will be pre-loaded in a custom format into the browsers IndexDb. Based on my understanding, transformer.js currently only supports loading models by URL and then caches them in the browser cache. Getting the model files from the IndexDb instead, seems a little tricky, as it would require to "copy" a lot of the loading logic.
Other ideas were to use a ServiceWorker to intercept the model download and mock the response with the files from IndexDb, or to write the files directly into browser cache that transformer.js uses.
Both solutions seem hacky... So, before I embark on writing my own loading logic, I wanted to ask, if you have any ideas or suggestions on how to approach this?
Thanks in advance!