Skip to main content

clika_runtime.modelverse.auto functions

kind_for​

kind_for(metadata: 'Any', task: 'str | None' = None, *, identity_only_purpose: 'str' = '') -> 'str'

The load door for a family, from task when given, else from the family's declared input and output modalities.

A text-in, text-out family loads as a text-generation model; a translation family declares the same modalities, so pass task="translation" to load it through the sequence-to-sequence door. A family whose one output door is unambiguous from its modalities needs no task: an image feature extractor (vision in, features out) is the image-embedding door. An identity-only family has no load door: identity_only_purpose is the catalog entry's statement of what it is (empty for a runnable family), and a family that carries one is refused by name before its modalities are read.

load​

load(source: 'str', *, task: 'str | None' = None, options: 'LoadOptions | None' = None, **load_options: 'Any') -> 'Any'

Load the model at source (a local directory, a hub repo id, or a .gguf file) through the door its family calls for.

task names the door explicitly (the model-hub task vocabulary, "text-generation", "automatic-speech-recognition", ...); without it the family's declared modalities decide. The remaining keyword arguments are :class:LoadOptions fields (device, dtype, max_seq, revision, cache_dir, token, offline, ...).