def validate_token()

in dell_ai/auth.py [0:0]


def validate_token(token: str) -> bool:
    """
    Validate a Hugging Face token by making a test API call.

    Args:
        token: The Hugging Face token to validate

    Returns:
        True if the token is valid, False otherwise
    """
    try:
        # Use whoami to validate the token
        whoami(token=token)
        return True
    except Exception:
        return False