import typing
from pathlib import Path


def valid_voice_dir(voice_dir: typing.Union[str, Path]) -> bool:
    """Return True if directory exists and has an onnx file"""
    voice_dir = Path(voice_dir)
    return voice_dir.is_dir() and (len(list(voice_dir.glob("*.onnx"))) > 0)