def filter_keys(model_keys):
    """ Remove untrainable variables left in pytorch .pth file.

    Args:
        model_keys: List of PyTorch model's state_dict keys
    
    Returns:
        A string list containing only the trainable variables
        from the PyTorch model's state_dict keys
    """
    to_remove = []
    for key in model_keys:
        if ("attn.relative_position_index" in key) or ("attn_mask" in key):
            to_remove.append(key)

    for a in to_remove:
        model_keys.remove(a)

    return model_keys