web-llm-runner 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js CHANGED
@@ -13622,8 +13622,8 @@ class WebLLM {
13622
13622
  return yield hasModelInCache(model_id);
13623
13623
  });
13624
13624
  }
13625
- download_model(model_id_1) {
13626
- return __awaiter(this, arguments, void 0, function* (model_id,
13625
+ download_model(model_id_1, progressCallback_1) {
13626
+ return __awaiter(this, arguments, void 0, function* (model_id, progressCallback,
13627
13627
  // @ts-ignore: TS1343 complains about es6 target instead of es2020
13628
13628
  workerUrl = new URL("./llm-worker.js", import.meta.url)) {
13629
13629
  if (!this.worker) {
@@ -13632,6 +13632,8 @@ class WebLLM {
13632
13632
  this.engine = yield CreateWebWorkerMLCEngine(this.worker, model_id, {
13633
13633
  initProgressCallback: (progress) => {
13634
13634
  this.downloadProgress[model_id] = progress.text;
13635
+ if (progressCallback)
13636
+ progressCallback(progress.text);
13635
13637
  },
13636
13638
  });
13637
13639
  });