Skip to content

Class: ModelDownloader

Defined in: utils/createModelDownloader.ts:180

Accessors

entrypointFilename

Get Signature

ts
get entrypointFilename(): string

Defined in: utils/createModelDownloader.ts:238

The filename of the entrypoint file that should be used to load the model.

Returns

string


entrypointFilePath

Get Signature

ts
get entrypointFilePath(): string

Defined in: utils/createModelDownloader.ts:245

The full path to the entrypoint file that should be used to load the model.

Returns

string


splitBinaryParts

Get Signature

ts
get splitBinaryParts(): undefined | number

Defined in: utils/createModelDownloader.ts:252

If the model is binary spliced from multiple parts, this will return the number of those binary parts.

Returns

undefined | number


totalFiles

Get Signature

ts
get totalFiles(): number

Defined in: utils/createModelDownloader.ts:261

The total number of files that will be saved to the directory. For split files, this will be the number of split parts, as multiple files will be saved. For binary-split files, this will be 1, as the parts will be spliced into a single file.

Returns

number


totalSize

Get Signature

ts
get totalSize(): number

Defined in: utils/createModelDownloader.ts:265

Returns

number


downloadedSize

Get Signature

ts
get downloadedSize(): number

Defined in: utils/createModelDownloader.ts:271

Returns

number

Methods

download()

ts
download(__namedParameters: {
  signal: AbortSignal;
 }): Promise<string>

Defined in: utils/createModelDownloader.ts:280

Parameters

ParameterType
__namedParameters{ signal: AbortSignal; }
__namedParameters.signal?AbortSignal

Returns

Promise<string>

The path to the entrypoint file that should be used to load the model


cancel()

ts
cancel(__namedParameters: {
  deleteTempFile: boolean;
 }): Promise<void>

Defined in: utils/createModelDownloader.ts:317

Parameters

ParameterTypeDescription
__namedParameters{ deleteTempFile: boolean; }-
__namedParameters.deleteTempFile?booleanDelete the temporary file that was created during the download. Defaults to the value of deleteTempFileOnCancel in the constructor.

Returns

Promise<void>