Skip to content

pretrained

allennlp_models.pretrained

[SOURCE]


get_tasks#

def get_tasks() -> Dict[str, TaskCard]

Returns a mapping of TaskCards for all tasks.

get_pretrained_models#

def get_pretrained_models() -> Dict[str, ModelCard]

Returns a mapping of ModelCards for all available pretrained models.

load_predictor#

def load_predictor(
    model_id: str,
    pretrained_models: Dict[str, ModelCard] = None,
    cuda_device: int = -1,
    overrides: Union[str, Dict[str, Any]] = None
) -> Predictor

Returns the Predictor corresponding to the given model_id.

The model_id should be key present in the mapping returned by get_pretrained_models.