Skip to content

alkove.Models

class Models(models: Mapping[str, _alkove.Model])

Models loaded once and shared by every Processor and Chain, in any thread.

Models.load(
names: Iterable[str] = ('focus', 'cue'),
*,
dir: Optional[Union[str, os.PathLike]] = None,
files: Optional[Mapping[str, Source]] = None,
cache: Optional[Union[str, os.PathLike]] = None,
download: bool = True,
) -> Models

files gives a path or the bytes of a model, dir a folder holding the .alk files, else they come from Hugging Face (fetch).

get(name: str) -> Optional[_alkove.Model]

The model of that name if it was loaded, else None: the handle the classes of this package take.