from pathlib import Path


def epoch_from_path(filename: Path) -> int:
    """
    Determine the epoch encded in a model filename.

    >>> epoch_from_path(Path('models/intermediate-2.1664-07.hdf5'))
    7
    """
    return int(filename.stem.split('-')[-1], base=10)