Uh oh!
There was an error while loading. Please reload this page.
migrate to transformers v5 - #12976
Conversation
Uh oh!
There was an error while loading. Please reload this page.
HuggingFaceDocBuilderDev
commented
Jan 15, 2026
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
| logger.addHandler(stream_handler) | ||
| @unittest.skipIf(is_transformers_version(">=", "4.57.5"), "Size mismatch") |
There was a problem hiding this comment.
Internal discussion: https://huggingface.slack.com/archives/C014N4749J9/p1768474502541349
| torch.nn.ConvTranspose2d, | ||
| torch.nn.ConvTranspose3d, | ||
| torch.nn.Linear, | ||
| torch.nn.Embedding, |
There was a problem hiding this comment.
Happening because of the way weight loading is done in v5.
| model = AutoModel.from_pretrained( | ||
| "hf-internal-testing/tiny-stable-diffusion-torch", subfolder="text_encoder", use_safetensors=False | ||
| ) |
There was a problem hiding this comment.
Internal discussion: https://huggingface.slack.com/archives/C014N4749J9/p1768462040821759
| input_ids = ( | ||
| input_ids["input_ids"] if not isinstance(input_ids, list) and "input_ids" in input_ids else input_ids | ||
| ) |
There was a problem hiding this comment.
Internal discussion https://huggingface.slack.com/archives/C014N4749J9/p1768537424692669
| inputs = { | ||
| "prompt": "dance monkey", | ||
| "negative_prompt": "", | ||
| "negative_prompt": "bad", |
There was a problem hiding this comment.
Otherwise, the corresponding tokenizer outputs:
negative_prompt=['']
prompt=['']
text_input_ids=tensor([], size=(1, 0), dtype=torch.int64)which leads to:
E RuntimeError: cannot reshape tensor of 0 elements into shape [1, 0, -1, 8] because the unspecified dimension size -1 can be any value and is ambiguousUh oh!
There was an error while loading. Please reload this page.
Hmm, https://github.com/huggingface/diffusers/actions/runs/21354964855/job/61460242386?pr=12976 fails on this PR but passes without any regrets on this https://github.com/huggingface/diffusers/actions/runs/21344761402/job/61450173169?pr=12996. So, I am not sure at this point what's happening TBH. Other failures seem to be already existing and well-known. |
sayakpaul
commented
Feb 24, 2026
Merging. |
Uh oh!
There was an error while loading. Please reload this page.
* switch to transformers main again./ * more * up * up * fix group offloading. * attributes * up * up * tie embedding issue. * fix t5 stuff for more. * matrix configuration to see differences between 4.57.3 and main failures. * change qwen expected slice because of how init is handled in v5. * same stuff. * up * up * Revert "up" This reverts commit 515dd06. * Revert "up" This reverts commit 5274ffd. * up * up * fix with peft_format. * just keep main for easier debugging. * remove torchvision. * empty * up * up with skyreelsv2 fixes. * fix skyreels type annotation. * up * up * fix variant loading issues. * more fixes. * fix dduf * fix * fix * fix * more fixes * fixes * up * up * fix dduf test * up * more * update * hopefully ,final? * one last breath * always install from main * up * audioldm tests * up * fix PRX tests. * up * kandinsky fixes * qwen fixes. * prx * hidream
What does this PR do?
Migrate to
transformersv5 and perform the changes necessary to facilitate that.Bunch of inline comments to make the reviewers aware of internal discussions.