from typing import Optional


def _init_webdataset_meta_from_local(remote: str, split: Optional[str] = None) -> bytes:
    """Read a WebDataset meta file from local filesystem.

    Args:
        remote (str): Local filesystem directory.
        split (str): Dataset split.
    """
    if split is None:
        path = f'{remote}/meta.json'
    else:
        path = f'{remote}/{split}/meta.json'
    return open(path, 'rb').read()