csm-1b / README.md
nielsr's picture
nielsr HF staff
Update README.md
bf2c439 verified
metadata
license: apache-2.0
pipeline_tag: text-to-speech
tags:
  - model_hub_mixin
  - pytorch_model_hub_mixin

This model has been pushed to the Hub using the PytorchModelHubMixin integration:

Installation

First install from here:

git clone -b add_hf https://github.com/NielsRogge/csm.git
cd csm
pip install -r requirements.txt

Usage

import torchaudio
from generator import load_csm_1b

generator = load_csm_1b(device="cuda")

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)