|
9 | 9 | */
|
10 | 10 |
|
11 | 11 | /**
|
12 |
| - * @typedef {Object} ProgressInfo |
13 |
| - * @property {'initiate' | 'download' | 'progress' | 'done'} status The status of the progress item. |
14 |
| - * @property {string} name This can be either: |
15 |
| - * - a string, the *model id* of a model repo on huggingface.co. |
16 |
| - * - a path to a *directory* potentially containing the file. |
17 |
| - * @property {string} file The name of the file |
18 |
| - * @property {number} [progress] A number between 0 and 100. Only available for the 'progress' status. |
19 |
| - * @property {number} [loaded] The number of bytes loaded. Only available for the 'progress' status. |
20 |
| - * @property {number} [total] The total number of bytes to be loaded. Only available for the 'progress' status. |
| 12 | + * @typedef {Object} InitiateProgressInfo |
| 13 | + * @property {'initiate'} status |
| 14 | + * @property {string} name The model id or directory path. |
| 15 | + * @property {string} file The name of the file. |
| 16 | + */ |
| 17 | + |
| 18 | +/** |
| 19 | + * @typedef {Object} DownloadProgressInfo |
| 20 | + * @property {'download'} status |
| 21 | + * @property {string} name The model id or directory path. |
| 22 | + * @property {string} file The name of the file. |
| 23 | + */ |
| 24 | + |
| 25 | +/** |
| 26 | + * @typedef {Object} ProgressStatusInfo |
| 27 | + * @property {'progress'} status |
| 28 | + * @property {string} name The model id or directory path. |
| 29 | + * @property {string} file The name of the file. |
| 30 | + * @property {number} progress A number between 0 and 100. |
| 31 | + * @property {number} loaded The number of bytes loaded. |
| 32 | + * @property {number} total The total number of bytes to be loaded. |
| 33 | + */ |
| 34 | + |
| 35 | +/** |
| 36 | + * @typedef {Object} DoneProgressInfo |
| 37 | + * @property {'done'} status |
| 38 | + * @property {string} name The model id or directory path. |
| 39 | + * @property {string} file The name of the file. |
| 40 | + */ |
| 41 | + |
| 42 | +/** |
| 43 | + * @typedef {Object} ReadyProgressInfo |
| 44 | + * @property {'ready'} status |
| 45 | + * @property {string} task The loaded task. |
| 46 | + * @property {string} model The loaded model. |
| 47 | + */ |
| 48 | + |
| 49 | +/** |
| 50 | + * @typedef {InitiateProgressInfo | DownloadProgressInfo | ProgressStatusInfo | DoneProgressInfo | ReadyProgressInfo} ProgressInfo |
21 | 51 | */
|
22 | 52 |
|
23 | 53 | /**
|
|
0 commit comments