Skip to content

Class: ModelDownloader

Accessors

entrypointFilename

ts
get entrypointFilename(): string

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

Returns

string

Defined in

utils/createModelDownloader.ts:238


entrypointFilePath

ts
get entrypointFilePath(): string

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

Returns

string

Defined in

utils/createModelDownloader.ts:245


splitBinaryParts

ts
get splitBinaryParts(): undefined | number

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

Returns

undefined | number

Defined in

utils/createModelDownloader.ts:252


totalFiles

ts
get totalFiles(): number

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

Defined in

utils/createModelDownloader.ts:261


totalSize

ts
get totalSize(): number

Returns

number

Defined in

utils/createModelDownloader.ts:265


downloadedSize

ts
get downloadedSize(): number

Returns

number

Defined in

utils/createModelDownloader.ts:271

Methods

download()

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

Parameters

ParameterType
__namedParametersobject
__namedParameters.signal?AbortSignal

Returns

Promise<string>

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

Defined in

utils/createModelDownloader.ts:280


cancel()

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

Parameters

ParameterTypeDescription
__namedParametersobject-
__namedParameters.deleteTempFile?booleanDelete the temporary file that was created during the download. Defaults to the value of deleteTempFileOnCancel in the constructor.

Returns

Promise<void>

Defined in

utils/createModelDownloader.ts:317