Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< 返回工具列表
C

csm

> 编程语言
开源

A Conversational Speech Generation Model

14.7K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

A Conversational Speech Generation Model

CSM

2025/05/20 - CSM is availabile natively in Hugging Face Transformers 🤗 as of version 4.52.1, more info available in our model repo

2025/03/13 - We are releasing the 1B CSM variant. The checkpoint is hosted on Hugging Face.


CSM (Conversational Speech Model) is a speech generation model from Sesame that generates RVQ audio codes from text and audio inputs. The model architecture employs a Llama backbone and a smaller audio decoder that produces Mimi audio codes.

A fine-tuned variant of CSM powers the interactive voice demo shown in our blog post.

A hosted Hugging Face space is also available for testing audio generation.

Requirements

  • A CUDA-compatible GPU
  • The code has been tested on CUDA 12.4 and 12.6, but it may also work on other versions
  • Similarly, Python 3.10 is recommended, but newer versions may be fine
  • For some audio operations, ffmpeg may be required
  • Access to the following Hugging Face models:
    • Llama-3.2-1B
    • CSM-1B

Setup

git clone [email protected]:SesameAILabs/csm.git
cd csm
python3.10 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

# Disable lazy compilation in Mimi
export NO_TORCH_COMPILE=1

# You will need access to CSM-1B and Llama-3.2-1B
huggingface-cli login

Windows Setup

The triton package cannot be installed in Windows. Instead use pip install triton-windows.

Quickstart

This script will generate a conversation between 2 characters, using a prompt for each character.

python run_csm.py

Usage

If you want to write your own applications with CSM, the following examples show basic usage.

Generate a sentence

This will use a random speaker identity, as no prompt or context is provided.

from generator import load_csm_1b
import torchaudio
import torch

if torch.backends.mps.is_available():
    device = "mps"
elif torch.cuda.is_available():
    device = "cuda"
else:
    device = "cpu"

generator = load_csm_1b(device=device)

audio = generator.generate(
    text="Hello from Sesame.",
    speaker=0,
    context=[],
    max_audio_length_ms=10_000,
)

torchaudio.save("audio.wav", audio.unsqueeze(0).cpu(), generator.sample_rate)

Generate with context

CSM sounds best when provided with context. You can prompt or provide context to the model using a Segment for each speaker's utterance.

NOTE: The following example is instructional and the audio files do not exist. It is intended as an example for using context with CSM.

…

FAQ

Does this model come with any voices?

The model open-sourced here is a base generation model. It is capable of producing a variety of voices, but it has not been fine-tuned on any specific voice.

Can I converse with the model?

CSM is trained to be an audio generation model and not a general-purpose multimodal LLM. It cannot generate text. We suggest using a separate LLM for text generation.

Does it support other languages?

The model has some capacity for non-English languages due to data contamination in the training data, but it likely won't do well.

Misuse and abuse ⚠️

This project provides a high-quality speech generation model for research and educational purposes. While we encourage responsible and ethical use, we explicitly prohibit the following:

  • Impersonation or Fraud: Do not use this model to generate speech that mimics real individuals without their explicit consent.
  • Misinformation or Deception: Do not use this model to create deceptive or misleading content, such as fake news or fraudulent calls.
  • Illegal or Harmful Activities: Do not use this model for any illegal, harmful, or malicious purposes.

By using this model, you agree to comply with all applicable laws and ethical guidelines. We are not responsible for any misuse, and we strongly condemn unethical applications of this technology.


Authors

Johan Schalkwyk, Ankit Kumar, Dan Lyth, Sefik Emre Eskimez, Zack Hodari, Cinjon Resnick, Ramon Sanabria, Raven Jiang, and the Sesame team.

GitHub Issues· 0 开放

在 GitHub 查看全部

暂无开放 Issues,或尚未同步最近议题。

核心特点

  • •A CUDA-compatible GPU
  • •The code has been tested on CUDA 12.4 and 12.6, but it may also work on other versions
  • •Similarly, Python 3.10 is recommended, but newer versions may be fine
  • •For some audio operations, ffmpeg may be required
  • •Access to the following Hugging Face models:
  • •Llama-3.2-1B
  • •Impersonation or Fraud: Do not use this model to generate speech that mimics real individuals without their explicit consent.
  • •Misinformation or Deception: Do not use this model to create deceptive or misleading content, such as fake news or fraudulent calls.
  • •Illegal or Harmful Activities: Do not use this model for any illegal, harmful, or malicious purposes.

> 标签

Python

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言