Change8

Migrating to Transformers v4.51.3-CSM-preview

Version v4.51.3-CSM-preview introduces 1 breaking change. This guide details how to update your code.

Released: 5/8/2025

1
Breaking Changes
5
Migration Steps
6
Affected Symbols

⚠️ Check Your Code

If you use any of these symbols, you need to read this guide:

CsmForConditionalGenerationAutoProcessorprocessor.apply_chat_templateprocessor.save_audiomodel.generatemodel.depth_decoder

Breaking Changes

Issue #1

The new CSM model and related components are introduced, which requires updating the `transformers` library version.

Solution

If you intend to use CSM, you must install the specific preview tag: `pip install git+https://github.com/huggingface/transformers@v4.51.3-CSM-preview`. Otherwise, no action is needed unless you rely on strict versioning, as this tag does not follow semantic versioning.

Migration Steps

  1. 1
    If you wish to use the new CSM model immediately, update your installation by running: pip install git+https://github.com/huggingface/transformers@v4.51.3-CSM-preview.
  2. 2
    If you are not using CSM, be aware that the next minor release, v4.52.0, will include this model, which might affect dependency resolution if you rely on strict minor version pinning.
  3. 3
    When using CSM, ensure you import `CsmForConditionalGeneration` from `transformers`.
  4. 4
    When preparing inputs for CSM, use the `AutoProcessor` and structure your input as a conversation list, potentially including text and audio content types, as demonstrated in the usage examples.
  5. 5
    When generating output, use `model.generate(**inputs, output_audio=True)` and process the resulting audio using `processor.save_audio()`.

Release Summary

This release introduces the Conversational Speech Model (CSM), an open-source contextual text-to-speech model capable of generating natural speech from multi-turn dialogue context.

Need More Details?

View the full release notes and all changes for Transformers v4.51.3-CSM-preview.

View Full Changelog