def load_from_hub(
    repo_id,
    revision=None,
    split=None,
    splits=None,
    subset=None,
    subsets=None,
    max_samples=None,
    batch_size=None,
    num_workers=None,
    overwrite=False,
    persistent=False,
    name=None,
    token=None,
    config_file=None,
    **kwargs,
):
    """Loads a dataset from the Hugging Face Hub into FiftyOne.

    Args:
        repo_id: the Hugging Face Hub identifier of the dataset
        revision (None): the revision of the dataset to load
        split (None): the split of the dataset to load
        splits (None): the splits of the dataset to load
        subset (None): the subset of the dataset to load
        subsets (None): the subsets of the dataset to load
        max_samples (None): the maximum number of samples to load
        batch_size (None): the batch size to use when loading samples
        num_workers (None): a suggested number of threads to use when
            downloading media
        overwrite (True): whether to overwrite an existing dataset with the
            same name
        persistent (False): whether the dataset should be persistent
        name (None): an optional name to give the dataset
        token (None): a Hugging Face API token to use. May also be provided via
            the ``HF_TOKEN`` environment variable
        config_file (None): the path to a config file on disk specifying how to
            load the dataset if the repo has no ``fiftyone.yml`` file
        **kwargs: keyword arguments specifying config parameters to load the
            dataset if the repo has no ``fiftyone.yml`` file

    Returns:
        a :class:`fiftyone.core.dataset.Dataset`
    """
    kwargs["splits"] = splits
    kwargs["split"] = split
    kwargs["subsets"] = subsets
    kwargs["subset"] = subset
    kwargs["max_samples"] = max_samples
    kwargs["batch_size"] = batch_size
    kwargs["num_workers"] = num_workers
    kwargs["overwrite"] = overwrite
    kwargs["persistent"] = persistent
    kwargs["name"] = name
    kwargs["token"] = token
    kwargs["config_file"] = config_file

    config = _get_dataset_metadata(repo_id, revision=revision, **kwargs)
    if config is None:
        raise ValueError(f"Could not find fiftyone metadata for {repo_id}")

    return _load_dataset_from_config(config, **kwargs)
Loads a dataset from the Hugging Face Hub into FiftyOne.

    Args:
        repo_id: the Hugging Face Hub identifier of the dataset
        revision (None): the revision of the dataset to load
        split (None): the split of the dataset to load
        splits (None): the splits of the dataset to load
        subset (None): the subset of the dataset to load
        subsets (None): the subsets of the dataset to load
        max_samples (None): the maximum number of samples to load
        batch_size (None): the batch size to use when loading samples
        num_workers (None): a suggested number of threads to use when
            downloading media
        overwrite (True): whether to overwrite an existing dataset with the
            same name
        persistent (False): whether the dataset should be persistent
        name (None): an optional name to give the dataset
        token (None): a Hugging Face API token to use. May also be provided via
            the ``HF_TOKEN`` environment variable
        config_file (None): the path to a config file on disk specifying how to
            load the dataset if the repo has no ``fiftyone.yml`` file
        **kwargs: keyword arguments specifying config parameters to load the
            dataset if the repo has no ``fiftyone.yml`` file

    Returns:
        a :class:`fiftyone.core.dataset.Dataset`
    
fiftyone/utils/huggingface.py