url()¶
- audmodel.url(uid, *, type='model', cache_root=None, verbose=False)[source]¶
URL to model archive or header.
- Parameters
uid (
str
) – unique model ID or short ID for latest versiontype (
str
) – return URL to specified type.'model'
corresponds to the archive file storing the model,'header'
to the model header, and'meta'
to the model metadatacache_root (
Optional
[str
]) – cache folder where models and headers are stored. If not setaudmodel.default_cache_root()
is usedverbose (
bool
) – show debug messages
- Return type
- Returns
URL
- Raises
audbackend.BackendError – if connection to repository on backend cannot be established
RuntimeError – if URL does not exist
ValueError – if wrong
type
is given
Examples
>>> path = url("d4e9c65b-3.0.0") >>> os.path.basename(path) 'd4e9c65b-3.0.0.zip' >>> path = url("d4e9c65b-3.0.0", type="header") >>> os.path.basename(path) 'd4e9c65b-3.0.0.header.yaml' >>> path = url("d4e9c65b-3.0.0", type="meta") >>> os.path.basename(path) 'd4e9c65b-3.0.0.meta.yaml'