Transformers v5

#3
by niknah - opened

What is needed to get this to work with transformers v5? There are no errors but there is nothing in the output.

Thanks

Edge0 org

Hi @niknah ,

Thanks for reporting this.

Currently, as specified in README, transformers>=4.57.0,<5is the version that we verified the release.

To help us further investigate compatibility with v5, could you kindly provide the info below:

  • Your exact Transformers and PyTorch versions, and whether you’re running on CPU or GPU.
  • A minimal script that reproduces the issue, including the generation and audio decoding steps.
  • What “nothing in the output” looks like—for example, empty generated codes, an empty waveform, or a missing audio file—and any warnings printed during execution.

These details would help us reproduce the issue.

torch 2.13.0+cu130
transformers 5.22.2 (Tried it on transformers v5.10 too)

I am using the same script as the front page.

The only warning is.
torch\nn\utils\weight_norm.py:144: FutureWarning: torch.nn.utils.weight_normis deprecated in favor oftorch.nn.utils.parametrizations.weight_norm. WeightNorm.apply(module, name, dim)

Here are some output examples.

Edge0 org

Hi @niknah ,

Thanks for the details. We reproduced the issue and have pushed a fix to this repository.

The cause: Two non-persistent RoPE buffers are not corrrectly rebuilt during Transformers v5 loading, due to the new initialization strategy started from this version.

The weight_norm message you may concern, however, is a separate unrelated warning from an older API used by the audio codec. That API still works, and the same warning also appears in successful runs after this fix.

Please restart your Python session and rerun the original example to load the updated code. No script changes are needed. If you’re using a local model folder, simply update its modeling_arktts.py from this repository.

We verified the fix with torch 2.13.0+cu130 and Transformers 5.22.2. Please let us know if this resolves it on your setup!

Sign up or log in to comment