def load_torch_hub_requirements(repo_or_dir, source="github"):
    """Loads the package requirements from the ``requirements.txt`` file on
    disk associated with a downloaded `PyTorch Hub <https://pytorch.org/hub>`_
    model.

    Example usage::

        import fiftyone.utils.torch as fout

        requirements = fout.load_torch_hub_requirements("facebookresearch/dinov2")

        print(requirements)
        # ['torch==2.0.0', 'torchvision==0.15.0', ...]

    Args:
        repo_or_dir: see :attr:`torch:torch.hub.load`
        source ("github"): see :attr:`torch:torch.hub.load`

    Returns:
        a list of requirement strings
    """
    req_path = find_torch_hub_requirements(repo_or_dir, source=source)
    if not os.path.isfile(req_path):
        logger.warning("No requirements.txt file found for '%s'", repo_or_dir)
        return []

    requirements = []
    with open(req_path, "r") as f:
        for line in f:
            line = _strip_comments(line)
            if line:
                requirements.append(line)

    return requirements
Loads the package requirements from the ``requirements.txt`` file on
    disk associated with a downloaded `PyTorch Hub <https://pytorch.org/hub>`_
    model.

    Example usage::

        import fiftyone.utils.torch as fout

        requirements = fout.load_torch_hub_requirements("facebookresearch/dinov2")

        print(requirements)
        # ['torch==2.0.0', 'torchvision==0.15.0', ...]

    Args:
        repo_or_dir: see :attr:`torch:torch.hub.load`
        source ("github"): see :attr:`torch:torch.hub.load`

    Returns:
        a list of requirement strings
    
fiftyone/utils/torch.py