Registry / ai-ml / coqui-tts-trainer

coqui-tts-trainer

JSON →
library0.4.0pypypiunverified

Coqui TTS Trainer is a general-purpose model trainer for PyTorch, designed to be flexible and extensible. It's part of the wider Coqui AI ecosystem, providing core training utilities for various deep learning models, including those for Text-to-Speech. The current version is 0.4.0, with releases occurring on an irregular, feature-driven cadence.

pip install coqui-tts-trainer
INSTALL
IMPORT
SIG · COQUI-TTS-TRAINER
C
coqui-tts-trainer
ai-mlpythonv0.4.0
Install
40.9s avg
Import
6249ms
Disk
4915MB
Pass rate
4/ 10
Env Coverage4 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v0.4.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
4/8 runs
✓ 47.3s
py 3.11
4/8 runs
✓ 42.65s
py 3.12
4/8 runs
✓ 37.75s
py 3.13
4/8 runs
✓ 35.93s
py 3.9
✕ build_error
4/8 runs
4915MB installed
● package 4915MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Trainer
✓ from trainer import Trainer
✗ from trainer import Trainer

This quickstart demonstrates how to set up a basic training loop using the `Trainer` class. It defines a simple PyTorch model and dataset, then configures the `Trainer` with a `TrainerConfig`, optimizer, scheduler, criterion, and data loaders. The `trainer.train()` method then executes the training process.

import torch import torch.nn as nn from torch.utils.data import DataLoader, Dataset from trainer.trainer import Trainer from trainer.generic_model_config import TrainerConfig # 1. Define a simple model class SimpleModel(nn.Module): def __init__(self): super().__init__() self.linear = nn.Linear(10, 2) def forward(self, x): return self.linear(x) # 2. Define a dummy dataset class DummyDataset(Dataset): def __len__(self): return 100 def __getitem__(self, idx): return torch.randn(10), torch.randint(0, 2, ()) # 3. Create a TrainerConfig config = TrainerConfig() config.num_epochs = 2 config.output_path = "./trainer_output" config.batch_size = 4 # 4. Instantiate model, optimizer, criterion, dataloaders model = SimpleModel() optimizer = torch.optim.Adam(model.parameters(), lr=0.001) scheduler = torch.optim.lr_scheduler.StepLR(optimizer, step_size=1, gamma=0.1) criterion = nn.CrossEntropyLoss() train_dataset = DummyDataset() eval_dataset = DummyDataset() train_loader = DataLoader(train_dataset, batch_size=config.batch_size) eval_loader = DataLoader(eval_dataset, batch_size=config.batch_size) # 5. Initialize and run the Trainer trainer = Trainer( config=config, model=model, optimizer=optimizer, scheduler=scheduler, criterion=criterion, data_loader_train=train_loader, data_loader_eval=eval_loader, grad_scaler=None, # For mixed precision, can be torch.cuda.amp.GradScaler() output_path=config.output_path ) trainer.train()
Debug
Known issues
breakingVersion 0.4.0 introduced backwards-incompatible changes by removing various unused functions and arguments to streamline the code. While primarily affecting internal APIs, direct use of previously available utility functions may break.
fix
Review your code for direct calls to internal `coqui-tts-trainer` helper functions. Update to a compatible version of the main `coqui` library (v0.28.0 or newer if using the full Coqui stack) if experiencing integration issues.
affects: 0.4.0 and later
breakingPython 3.9 support was dropped starting from version 0.2.1. The library now requires Python >=3.10 and <3.15.
fix
Upgrade your Python environment to version 3.10, 3.11, 3.12, 3.13, or 3.14. Using Python 3.15 or newer is not yet supported.
affects: 0.2.1 and later
breakingIn version 0.3.0, the Coqui's custom LR schedulers adopted the standard PyTorch scheduler interface. This change, along with fixes to model/scheduler state restoration, might break custom scheduler implementations or existing checkpoint loading logic.
fix
Ensure your custom schedulers adhere to the standard `torch.optim.lr_scheduler` interface. Review any custom logic for loading optimizer/scheduler states from checkpoints to align with the updated restoration behavior.
affects: 0.3.0 and later
gotchaAs of v0.2.0, `coqui-tts-trainer` switched to using a forked version of the `coqpit` library (from `idiap/coqui-ai-coqpit`). If you have other projects or an older `coqpit` installed, ensure compatibility or use a virtual environment.
fix
Use a dedicated virtual environment to manage dependencies, preventing conflicts with other `coqpit` installations. The `coqui-tts-trainer` package will automatically install its required forked `coqpit` version.
affects: 0.2.0 and later
gotchaStarting from v0.3.3, `numpy` and `soundfile` were removed from the *core* dependencies. While still available via `[cpu]` and `[cuda]` extras, their absence from a minimal install might cause `ModuleNotFoundError` if you implicitly relied on them.
fix
Explicitly install `coqui-tts-trainer` with the `[cpu]` or `[cuda]` extras (e.g., `pip install coqui-tts-trainer[cpu]`) if your training pipeline requires `numpy` or `soundfile`.
affects: 0.3.3 and later
Upgrade
Version history
0.4.0latest on PyPI · released Apr 10, 2026
Audit
Dependencies
torchrequiredCore deep learning framework dependency.
torchvisionrequiredCore deep learning framework dependency.
torchaudiorequiredCore deep learning framework dependency.
coqpitrequiredConfiguration parsing and management.
einopsrequiredTensor manipulation utility.
scipyrequiredScientific computing utilities, often used in data processing.
tqdmrequiredProgress bar for iterations.
richrequiredRich terminal output.
hjsonrequiredHJSON configuration file parser.
wandboptionalExperiment tracking and visualization (optional extra).
tensorboardoptionalExperiment tracking and visualization (optional extra).
numpyoptionalNumerical computing (included with `[cpu]` and `[cuda]` extras).
soundfileoptionalAudio file handling (included with `[cpu]` and `[cuda]` extras).
Agent activity
21 hits · last 30 days
node
18
OpenAI (training)
1
Resources
coqui-tts-trainer — pip install coqui-tts-trainer · libregistry