espnet2.utils.pretrained.build_pretrained
Less than 1 minute
espnet2.utils.pretrained.build_pretrained
espnet2.utils.pretrained.build_pretrained(loader: Any, model_tag: str, device: str, what: str, remedy: str, **kwargs: Any)
Load a published model, or say why this tag cannot serve this task.
The downloader hands a model’s own artifact keys to the constructor, so a tag published for another task arrives as an unexpected keyword argument. Only that is translated: every other TypeError is a bug worth seeing in full rather than being blamed on the user’s choice of model.
- Parameters:
- loader – The inference class, e.g.
Text2Speech. - model_tag – The tag to load.
- device – Passed to the constructor.
- what – How the caller names itself in the message, e.g.
"espnet synthesize"or"espnet.load(task='tts')". - remedy – One sentence telling the user how to pick another tag.
- **kwargs – Further constructor arguments.
- loader – The inference class, e.g.
