Skip to main content

Run Retrieval-based Voice Conversion training and inference with ease.

Project description

ZeroRVC

Run Retrieval-based Voice Conversion training and inference with ease.

Features

  • Dataset Preparation / Upload to Hugging Face Datasets
  • Accelerate with Hugging Face Accelerate
  • Easy Trainer API
  • Inference API

Training

import os
from accelerate import Accelerator
from tqdm import tqdm
from zerorvc import RVCTrainer, prepare

HF_TOKEN = os.environ.get("HF_TOKEN")
accelerator = Accelerator()

dataset = prepare(
    "./my-voices", 
    hubert="./models/hubert_base.pt", rmvpe="./models/rmvpe.pt", 
    accelerator=accelerator
)
dataset.push_to_hub("my-rvc-dataset", token=HF_TOKEN)

epochs = 100
trainer = RVCTrainer(checkpoint_dir="./checkpoints")
training = tqdm(
    trainer.train(
        dataset=dataset["train"],
        resume_from=trainer.latest_checkpoint(),
        epochs=epochs, batch_size=8, accelerator=accelerator
    ),
    desc="Training", total=epochs
)
for checkpoint in training:
    training.set_description(
        f"Epoch {checkpoint.epoch}/{epochs} loss: (gen: {checkpoint.loss_gen:.4f}, fm: {checkpoint.loss_fm:.4f}, mel: {checkpoint.loss_mel:.4f}, kl: {checkpoint.loss_kl:.4f}, disc: {checkpoint.loss_disc:.4f})"
    )
    if checkpoint.epoch % 2 == 0:
        checkpoint.save(checkpoint_dir=trainer.checkpoint_dir)
        checkpoint.G.push_to_hub("my-rvc-model", token=HF_TOKEN)
print("Training completed.")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zerorvc-0.0.1.tar.gz (29.0 kB view details)

Uploaded Source

Built Distribution

zerorvc-0.0.1-py3-none-any.whl (37.3 kB view details)

Uploaded Python 3

File details

Details for the file zerorvc-0.0.1.tar.gz.

File metadata

  • Download URL: zerorvc-0.0.1.tar.gz
  • Upload date:
  • Size: 29.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.0

File hashes

Hashes for zerorvc-0.0.1.tar.gz
Algorithm Hash digest
SHA256 84bd7da39541cb755147f87a5075b2120da306cb563c65d856f60f124058af0e
MD5 287155a54cb154deb956d1012219029a
BLAKE2b-256 f9719707bace8ed45bb02100e3e9d54dcdb12fd74109c82cc3ccfc8e4f0dd09f

See more details on using hashes here.

File details

Details for the file zerorvc-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: zerorvc-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 37.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.0

File hashes

Hashes for zerorvc-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 88a6eb3e892254f2b80f0e59fbbbf28b8b924873f85c288e8ccd6b09307d3cfc
MD5 53886772e999d68a0cd0f0102d519ae0
BLAKE2b-256 340004f4618938914bfc6a1fbd3a3e72e7ee8611a49ca48bf7fb480c1a92cb09

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page