def ensure_torch_hub_requirements(
    repo_or_dir, source="github", error_level=None, log_success=False
):
    """Verifies that the package requirements from the ``requirements.txt``
    file on disk associated with a downloaded
    `PyTorch Hub <https://pytorch.org/hub>`_ model are installed.

    Example usage::

        import fiftyone.utils.torch as fout

        fout.ensure_torch_hub_requirements("facebookresearch/dinov2")

    Args:
        repo_or_dir: see :attr:`torch:torch.hub.load`
        source ("github"): see :attr:`torch:torch.hub.load`
        error_level (None): the error level to use, defined as:

            -   0: raise error if requirement is not satisfied
            -   1: log warning if requirement is not satisfied
            -   2: ignore unsatisifed requirements

            By default, ``fiftyone.config.requirement_error_level`` is used
        log_success (False): whether to generate a log message if a requirement
            is satisfied
    """
    for req_str in load_torch_hub_requirements(repo_or_dir, source=source):
        fou.ensure_package(
            req_str, error_level=error_level, log_success=log_success
        )
Verifies that the package requirements from the ``requirements.txt``
    file on disk associated with a downloaded
    `PyTorch Hub <https://pytorch.org/hub>`_ model are installed.

    Example usage::

        import fiftyone.utils.torch as fout

        fout.ensure_torch_hub_requirements("facebookresearch/dinov2")

    Args:
        repo_or_dir: see :attr:`torch:torch.hub.load`
        source ("github"): see :attr:`torch:torch.hub.load`
        error_level (None): the error level to use, defined as:

            -   0: raise error if requirement is not satisfied
            -   1: log warning if requirement is not satisfied
            -   2: ignore unsatisifed requirements

            By default, ``fiftyone.config.requirement_error_level`` is used
        log_success (False): whether to generate a log message if a requirement
            is satisfied
    
fiftyone/utils/torch.py