def get_all_relative_imports(file_path: str) -> set[str]:
    """Get all relative imports from a file.

    Args:
        file_path (str): The file to process.

    Returns:
        set[str]: The relative imports.
    """
    with open(file_path, 'r', encoding='utf-8') as f:
        source = f.read()

    tree = ast.parse(source)
    relative_imports = set()
    for node in ast.walk(tree):
        if isinstance(
            node,
            ast.ImportFrom,
        ) and node.module is not None and node.level == 1:
            relative_imports.add(node.module)

    return relative_imports
Get all relative imports from a file.

    Args:
        file_path (str): The file to process.

    Returns:
        set[str]: The relative imports.
    
llmfoundry/utils/huggingface_hub_utils.py