Optional
fetchA function used to override the window.fetch
function.
Optional
init: RequestInitOptional
init: RequestInitOptional
init: RequestInitOptional
fromTFHubWhether the module or model is to be loaded from TF Hub.
Setting this to true
allows passing a TF-Hub module URL, omitting the
standard model file name and the query parameters.
Default: false
.
Optional
onProgress callback.
Optional
requestRequestInit (options) for HTTP requests.
For detailed information on the supported fields, see https://developer.mozilla.org/en-US/docs/Web/API/Request/Request
Optional
streamWhether to stream the model directly to the backend or cache all its weights on CPU first. Useful for large models.
Optional
strictStrict loading model: whether extraneous weights or missing
weights should trigger an Error
.
If true
, require that the provided weights exactly match those
required by the layers. false
means that both extra weights
and missing weights will be silently ignored.
Default: true
.
Optional
weightPath prefix for weight files, by default this is calculated from the path of the model JSON file.
For instance, if the path to the model JSON file is
http://localhost/foo/model.json
, then the default path prefix will be
http://localhost/foo/
. If a weight file has the path value
group1-shard1of2
in the weight manifest, then the weight file will be
loaded from http://localhost/foo/group1-shard1of2
by default. However,
if you provide a weightPathPrefix
value of
http://localhost/foo/alt-weights
, then the weight file will be loaded
from the path http://localhost/foo/alt-weights/group1-shard1of2
instead.
Optional
weightAn async function to convert weight file name to URL. The weight file names are stored in model.json's weightsManifest.paths field. By default we consider weight files are colocated with the model.json file. For example: model.json URL: https://www.google.com/models/1/model.json group1-shard1of1.bin url: https://www.google.com/models/1/group1-shard1of1.bin
With this func you can convert the weight file name to any URL.
Innamespace
io