Hi everyone,
I have noticed an issue regarding the download progress monitoring of the on-device LanguageModel.
I need to display a download progress bar on my page. However, when I use the following code to monitor the download progress, the value retrieved from e.loaded always restarts calculation from 0. This means that if the page is refreshed, the download progress resets to 0, which is confusing for users.
I verified the actual status by checking chrome://on-device-internals/ > Model Status. It clearly shows that the actual download progress is not 0% (provided the browser process is not closed).
Code Snippet:
```javascript
await LanguageModel.create({
monitor: (m) => {
m.addEventListener('downloadprogress', (e) => {
console.log(`DownloadProgress: ${parseFloat((e.loaded * 100).toFixed(2))} %`);
});
},
expectedInputs: [
{ type: 'text', languages: ['en'] }
],
});
```
Environment:
Browser Version: Chrome 144+
Steps to Reproduce:
Expected Result:
In the new tab, the download progress should reflect the actual status (e.g., starting from 5%).
Actual Result:
Has anyone else encountered this behavior? Any insights would be appreciated.
Thanks!
--
You received this message because you are subscribed to the Google Groups "Chrome Built-in AI Early Preview Program Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chrome-ai-dev-previe...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/chrome-ai-dev-preview-discuss/ed0d3e50-d44b-4826-b690-d46733a78147n%40chromium.org.