def is_tflite_model(model_path):
    """Check if a model is of TFLite type

    Parameters:
    ----------
    model_path: str
        Path to model

    Returns
    ----------
    bool:
        True if given path is a valid TFLite model
    """

    try:
        with open(model_path, "rb") as f:
            hdr_bytes = f.read(8)
            hdr_str = hdr_bytes[4:].decode("utf-8")
            if hdr_str == "TFL3":
                return True
            else:
                return False
    except:
        return False