voxcpm2-dagbani-sft / README.md
FarmerlineML's picture
Add model card with val loss table and usage example
5afa0f5 verified
|
Raw
History Blame Contribute Delete
3.23 kB
metadata
base_model: openbmb/VoxCPM2
language:
  - dag
language_bcp47:
  - dag-gh
tags:
  - text-to-speech
  - full-finetune
  - dagbani
  - farmerline
  - african-languages
license: apache-2.0

VoxCPM2 Dagbani β€” Full SFT

Full fine-tune of VoxCPM2 on Dagbani speech data. Trained by FarmerlineML for the darli AI agricultural voice assistant.

Training Details

Parameter Value
Base model openbmb/VoxCPM2 (2B)
Method Full SFT (all parameters)
Learning rate 1e-5
Batch size 1 (grad accum 16, effective batch 16)
Sample rate 16kHz (AudioVAE encoder input)
Final step 3062

Validation Loss:

Step loss/total loss/diff loss/stop
0 1.107430 0.857099 0.166888
500 0.868330 0.819919 0.032275
1000 0.864477 0.812996 0.034321
1500 0.855272 0.806172 0.032734
2000 0.870591 0.798133 0.048305
2500 0.865124 0.800481 0.043095
3000 0.851482 0.798783 0.035133

Datasets:

Usage

from voxcpm import VoxCPM
import soundfile as sf
import numpy as np

model = VoxCPM.from_pretrained(
    "FarmerlineML/voxcpm2-dagbani-sft",
    load_denoiser=False,
)

def trim_audio(wav, sr, silence_thresh=0.01, max_silence_secs=2.0):
    abs_wav = np.abs(wav)
    window  = int(0.05 * sr)
    n_wins  = len(abs_wav) // window
    max_sil = int(max_silence_secs / 0.05)
    silence_count, cut_sample = 0, len(wav)
    for w in range(n_wins):
        chunk = abs_wav[w * window:(w + 1) * window]
        if chunk.max() < silence_thresh:
            silence_count += 1
            if silence_count >= max_sil:
                cut_sample = (w - max_sil + 1) * window
                break
        else:
            silence_count = 0
    return wav[:min(cut_sample + int(0.1 * sr), len(wav))]

wav = model.generate(
    text="a nyΙ›la Dagbanli lΙ”ri yubu daluu",
    reference_wav_path="your_dagbani_speaker.wav",
    cfg_value=2.0,
    inference_timesteps=15,
    retry_badcase=False,
    max_len=max(50, len(text) * 4),
)
wav = trim_audio(wav, 48000)
sf.write("output.wav", wav, 48000)

Repo Structure

β”œβ”€β”€ model.safetensors        # Model weights (~9.2GB)
β”œβ”€β”€ audiovae.pth             # AudioVAE decoder
β”œβ”€β”€ config.json              # Model architecture config
β”œβ”€β”€ tokenizer.json           # Tokenizer
β”œβ”€β”€ training/
β”‚   β”œβ”€β”€ train.log            # Full training log
β”‚   β”œβ”€β”€ val_loss_summary.txt # Validation losses per checkpoint
β”‚   └── training_state.json  # Final training state
└── tensorboard/             # TensorBoard event files

Notes

  • Reference audio is required at inference for voice identity anchoring
  • Use max_len=max(50, len(text) * 4) to prevent hallucination after sentence end
  • A post-generation 2-second silence trim is strongly recommended