web-llm
web-llm copied to clipboard
How to let the user cancel loading the model and stop it from fetching params
Hello quick question! I was wondering, after you create the engine (in the step below) and the cache starts getting populated, how do you code a cancel button for a user to cancel downloading the model/quit the task. Is there a method that can be called? In this example to stop the response llm.abort(); but I would like to understand what abort() is being called on and how can I get there from the simple implementation found below.
const engine = await CreateMLCEngine( selectedModel, { initProgressCallback: initProgressCallback }, // engineConfig );
Thank you!
@customautosys