-
Notifications
You must be signed in to change notification settings - Fork 873
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Worker] Move reload upon worker termination to WebWorker (#533)
In #471, we add `modelId` and `chatOpts` to `ServiceWorkerMLCEngineHandler ` and `ExtensionServiceWorkerMLCEngineHandler`. The motivation was to reload the model once the handler detects an out-of-sync between what the frontend engine expects versus what the low-level engine is loaded with. This out-of-sync usually happens when a service worker is killed unexpectedly. Recently, it is observed that such out-of-sync can happen in web worker as well. Therefore, we move the logic to `WebWorkerMLCEngineHandler`. The aforementioned handlers calls `super.onmessage()` at the end, so no change in behavior is expected from them. Tested in WebLLMChat, intentionally terminating service worker and sending another message trigger the same behavior as before.
- Loading branch information
1 parent
b0486fc
commit 5472977
Showing
3 changed files
with
41 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters