The PoC, we are basing this rewrite on, uses a crude, ad hoc solution for downloading and loading model files, see: https://github.com/barhanc/rnet-poc/blob/main/src/hooks/useModelDownload.ts. We should instead use the ResourceFetcher package. The PR referencing this issue should also add something like a download function so that it is possible to use create<Task> api with pre-exported models defined in models.ts as create<Task>(download(models.<task>.MODEL_CONSTANT)).
Here is an example of minimal storage implementation using 'react-native-blob-util' https://github.com/callstackincubator/ai/blob/main/packages/llama/src/storage.ts.
The PoC, we are basing this rewrite on, uses a crude, ad hoc solution for downloading and loading model files, see: https://github.com/barhanc/rnet-poc/blob/main/src/hooks/useModelDownload.ts. We should instead use the ResourceFetcher package. The PR referencing this issue should also add something like a
downloadfunction so that it is possible to usecreate<Task>api with pre-exported models defined inmodels.tsascreate<Task>(download(models.<task>.MODEL_CONSTANT)).Here is an example of minimal storage implementation using 'react-native-blob-util' https://github.com/callstackincubator/ai/blob/main/packages/llama/src/storage.ts.