LoadOptions
Defined in: packages/runntime/src/zoo/load.ts:18
Options accepted by every create
Properties
Section titled “Properties”cache?
Section titled “cache?”
optionalcache?:WeightCache
Defined in: packages/runntime/src/zoo/load.ts:20
Saves fetched bytes. The next load reads them from here, no network.
cacheId?
Section titled “cacheId?”
optionalcacheId?:string
Defined in: packages/runntime/src/zoo/load.ts:22
Cache key. Defaults to the URL’s file name; required for a RangeSource.
onBytes?
Section titled “onBytes?”
optionalonBytes?: (chunkBytes) =>void
Defined in: packages/runntime/src/zoo/load.ts:26
Called per fetched network chunk with its size in bytes.
Parameters
Section titled “Parameters”chunkBytes
Section titled “chunkBytes”number
Returns
Section titled “Returns”void
onProgress?
Section titled “onProgress?”
optionalonProgress?: (name,doneBytes,totalBytes) =>void
Defined in: packages/runntime/src/zoo/load.ts:24
Called while tensors upload: tensor name, bytes done, bytes total.
Parameters
Section titled “Parameters”string
doneBytes
Section titled “doneBytes”number
totalBytes
Section titled “totalBytes”number
Returns
Section titled “Returns”void
signal?
Section titled “signal?”
optionalsignal?:AbortSignal
Defined in: packages/runntime/src/zoo/load.ts:28
Stops the load between steps. A step already running finishes first.
warmUp?
Section titled “warmUp?”
optionalwarmUp?:boolean
Defined in: packages/runntime/src/zoo/load.ts:34
Runs the model once on a blank input before returning, which compiles the kernels and fails the load with EXECUTION_FAILED when the GPU errors or returns unusable output. With false, the first call pays the compile time, and a GPU error is not caught: most tasks return zeros instead of throwing. Default: true.