Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. CreateMonitor

CreateMonitor

Experimental:This is anexperimental technology
Check theBrowser compatibility table carefully before using this in production.

Secure context: This feature is available only insecure contexts (HTTPS), in some or allsupporting browsers.

TheCreateMonitor interface provides information on the progress of an AI model download or some fine-tuning data for the model.

It can be used via:

EventTarget CreateMonitor

Events

Inherits events from its parent,EventTarget.

downloadprogressExperimental

Fired when progress is made on the AI model download.

Examples

BasicCreateMonitor usage

ACreateMonitor instance is used via themonitor property of an AI API'screate() method (Summarizer.create() is shown below). Themonitor property takes a callback function as a value, the argument of which is theCreateMonitor instance. You can then monitor download progress via the instance'sdownloadprogress event.

js
const summarizer = await Summarizer.create({  sharedContext:    "A general summary to help a user decide if the text is worth reading",  monitor(monitor) {    monitor.addEventListener("downloadprogress", (e) => {      console.log(`download progress: ${e.loaded}/${e.total}`);    });  },});const summary = await summarizer.summarize(myText);

Specifications

Specification
Writing Assistance APIs
# createmonitor

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp