Skip to main content

load_pretrained

load_pretrained(model_id, revision=None, cache_dir=None, repo_id=None, **kwargs)

Load a published model, from the Hugging Face Hub or a local directory.

Args: model_id (str or Path): A Hugging Face repo id (owner/name), or a path to an already-downloaded model directory. revision (str, optional): Hugging Face branch/tag to pin, e.g. "2026_W32". Omitted, it resolves to main, which tracks the currently recommended model and moves when a new vintage is published. cache_dir (Path, optional): Where downloads are placed. repo_id (str, optional): Hugging Face repository, when it cannot be read off model_id.

Returns: A model wrapper exposing .predict(df), .selftest() and .index. Which class depends on the manifest’s model_class.

Raises: ValueError: If the manifest declares a model_class with no registered wrapper.