Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the Browser's Cache Storage if it's available, to avoid re-downloading models #3

Merged
merged 1 commit into from
Nov 27, 2023

Conversation

felladrin
Copy link
Contributor

Hi! Thank you for creating this lib! It seems to be the first one to use llama.cpp wasm!

While trying it on the Playground, I noticed the models were not being cached, so I made a small change on the loadBinaryResource function so the models load instantly if they have already been downloaded and we refresh the page. This is the same strategy used by Candle, Transformers.js, and Web-LLM libs.

Hope it's useful!

Cheers!

@rahuldshetty rahuldshetty mentioned this pull request Nov 27, 2023
@rahuldshetty rahuldshetty merged commit 001176a into rahuldshetty:master Nov 27, 2023
@rahuldshetty
Copy link
Owner

Hey, Thanks for this PR. I've merged this into the main branch. I had to add in some checks and switch to WebWorker Cache as the Window object was not available inside Web Worker.

Great QoL addition 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants