MCPcopy Index your code
hub / github.com/Scarfmonster/HiFiPLN

github.com/Scarfmonster/HiFiPLN @v2.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.0 ↗ · + Follow
477 symbols 1,375 edges 56 files 29 documented · 6%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

HiFiPLN

Multispeaker Community Vocoder model for DiffSinger

This is the code used to train the "HiFiPLN" vocoder.

A trained model for use with OpenUtau is available for download on the official release page.

Why HiFiPLN?

Because a lot of PLN was spent training this thing.

Training

Python

Python 3.10 or 3.11 is required.

Data preparation

Preperocessing and splitting the dataset into smaller files is done using a single script. Note that if the input files are shorter than --length seconds, they will be skipped. It is better to provide full unsegmented files to the script, but if your input files are already split into chunks, you can run with --length 0 to disable splitting.

python preproc.py --config PATH_TO_CONFIG -o "dataset/train" --length 1 PATH_TO_TRAIN_DATASET

You will also need to provide some validation audio files. Run preproc.py with --length 0 to disable segmenting.

python preproc.py --config PATH_TO_CONFIG -o "dataset/valid" --length 0 PATH_TO_VALIDATION_DATASET

Train model

python train.py --config "configs/hifipln.yaml"
  • If you see an error saying "Total length of `Data Loader` across ranks is zero" then you do not have enough validation files.
  • You may want to edit configs/hifipln.yaml and change train: batch_size: 12 to a value that better fits your available VRAM.

Resume

python train.py --config "configs/hifipln.yaml" --resume CKPT_PATH

You may set CKPT_PATH to a log directory (eg. logs/HiFiPLN), and it will find the last checkpoint of the last run.

Finetuning

Download a checkpoint from https://utau.pl/hifipln/#checkpoints-for-finetuning \ Save the checkpoint as ckpt/HiFiPLN.ckpt then run:

python train.py --config "configs/hifipln-finetune.yaml"
  • Finetuning shouldn't be run for too long, especially for small datasets. Just 2-3 epochs or ~20000 steps should be fine.

Exporting for use in OpenUtau

python export.py --config configs/hifipln.yaml --output out/hifipln --model CKPT_PATH

You may set CKPT_PATH to a log directory (eg. logs/HiFiPLN), and it will find the last checkpoint of the last run.

Credits

Core symbols most depended-on inside this repo

load_state_dict
called by 17
model/utils.py
get_padding
called by 15
model/hifigan/hifigan.py
get_mel
called by 13
model/utils.py
stft
called by 13
model/stft.py
get_norm
called by 12
model/utils.py
state_dict
called by 11
model/utils.py
interpolate
called by 11
pitch/pe.py
istft
called by 8
model/stft.py

Shape

Method 303
Class 105
Function 69

Languages

Python100%

Modules by API surface

model/hifigan/hifigan.py33 symbols
model/layers.py28 symbols
pitch/pe.py26 symbols
pitch/rmvpe/deepunet.py24 symbols
model/ddsp/pcmer.py24 symbols
model/hifiplnv2/loss.py23 symbols
model/sinsum/loss.py21 symbols
model/utils.py19 symbols
model/sinsum/trainer.py19 symbols
model/hifiplnv2/trainer.py19 symbols
model/act.py18 symbols
data.py15 symbols

For agents

$ claude mcp add HiFiPLN \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact