Skip to content

5.0.0 tie_embeddings_and_encoder_decoder removed without indication #43097

@AmitMY

Description

@AmitMY

System Info

  • transformers version: 5.0.0.dev0 (main branch)
  • Platform: Linux
  • Python version: 3.12
  • PyTorch version: 2.x with CUDA
  • GPU: NVIDIA (tested)

Who can help?

@stevhliu

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
  • My own task or dataset (give details below)

Reproduction

In version 4 of transformers, there's a method tie_embeddings_and_encoder_decoder.
This method is not present in version 5, without a deprecation note in the release notes.

Run:

from transformers import AutoTokenizer, AutoModelForMaskedLM

model_id = "answerdotai/ModernBERT-base"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForMaskedLM.from_pretrained(model_id)

model.tie_embeddings_and_encoder_decoder()

Expected behavior

deprecation notice / docs what to do instead

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions