src/transformers/models/marian/convert_marian_to_pytorch.py/remove_suffix
def remove_suffix(text: str, suffix: str):
    if text.endswith(suffix):
        return text[: -len(suffix)]
    return text  # or whatever