Downloads · 30 days
0
amanuelbyte/chatterbox-fr-lora-v2
chatterbox-fr-lora-v2 is a text-to-speech model from amanuelbyte. Use it when you need text read aloud. It is set up for transformers.
This repository contains a highly optimized LoRA adapter for the Chatterbox Multilingual TTS model, fine-tuned specifically for high-fidelity English-to-French cross-lingual voice cloning.
Downloads · 30 days
0
Access
Public
Updated Apr 1, 2026
Repo size
524 MB
Likes
0
Public
Click a slice to open those files.
.pt506 MB · 97%
From the Hugging Face model README
This repository contains a highly optimized LoRA adapter for the Chatterbox Multilingual TTS model, fine-tuned specifically for high-fidelity English-to-French cross-lingual voice cloning.
q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_projBy switching to a low-redundancy "Sparse" dataset and training with Rank 32, this model achieves near-zero-shot levels of speaker preservation while significantly improving French phonetic accuracy.
You must have the Chatterbox framework installed to use this adapter.
import torch
import torch.nn as nn
from huggingface_hub import hf_hub_download
from chatterbox.mtl_tts import ChatterboxMultilingualTTS
# 1. Define LoRA mapping helper
class LoRALayer(nn.Module):
def __init__(self, original, rank=32, alpha=64.0, dropout=0.05):
super().__init__()
self.original_layer = original
self.scaling = alpha / rank
in_f, out_f = original.in_features, original.out_features
dev, dt = original.weight.device, original.weight.dtype
self.lora_A = nn.Parameter(torch.zeros(rank, in_f, device=dev, dtype=dt))
self.lora_B = nn.Parameter(torch.zeros(out_f, rank, device=dev, dtype=dt))
self.lora_dropout = nn.Dropout(dropout) if dropout > 0 else nn.Identity()
for p in self.original_layer.parameters():
p.requires_grad = False
def forward(self, x):
return self.original_layer(x) + (self.lora_dropout(x) @ self.lora_A.T @ self.lora_B.T * self.scaling)
# 2. Load Base Model
device = "cuda" if torch.cuda.is_available() else "cpu"
model = ChatterboxMultilingualTTS.from_pretrained(device=device)
# 3. Download and Inject LoRA
lora_path = hf_hub_download(repo_id="amanuelbyte/chatterbox-fr-lora-v2", filename="best_lora_adapter.pt")
payload = torch.load(lora_path, map_location=device, weights_only=True)
lora_sd = payload.get("lora_state_dict", payload)
targets = ["q_proj", "k_proj", "v_proj", "o_proj", "gate_proj", "up_proj", "down_proj"]
for name, module in model.t3.named_modules():
if isinstance(module, nn.Linear) and any(x in name for x in targets):
parent_name, child_name = ".".join(name.split(".")[:-1]), name.split(".")[-1]
parent = model.t3.get_submodule(parent_name)
setattr(parent, child_name, LoRALayer(module))
# Load the weights into the injected layers
current_sd = model.t3.state_dict()
for key, value in lora_sd.items():
if key in current_sd:
current_sd[key] = value.to(device)
model.t3.load_state_dict(current_sd, strict=False)
model.t3.eval()
# 4. Generate Audio
import torchaudio
text = "Bonjour, bienvenue à cette démonstration de clonage vocal cross-lingue!"
ref_audio_path = "path/to/english_voice.wav"
with torch.inference_mode():
wav = model.generate(text, audio_prompt_path=ref_audio_path, language_id="fr")
torchaudio.save("output_french.wav", wav.cpu().unsqueeze(0), 16000)