ngxson / wllama

WebAssembly binding for llama.cpp - Enabling in-browser LLM inference
https://ngxson.github.io/wllama/examples/basic/
MIT License
231 stars 5 forks source link

How to cleanly abort downloading a model? #83

Open flatsiedatsie opened 2 days ago

flatsiedatsie commented 2 days ago

Sometimes a model will start downloading, but then you realize it's the wrong one, or it's going to take too long, etc.

I'd like to offer users a "cancel download" button. But how would I implement it cleanly? For example, so that already downloaded chunks are also removed, and Wllama ends up in an 'nothing loaded yet' state.

ngxson commented 2 days ago

Probably it can be archived using fetch API AbortController