base_config:
  - configs/variance.yaml

dictionaries:
  zh: dictionaries/opencpop-extension.txt
extra_phonemes: []
merged_phoneme_groups: []

datasets:
  - raw_data_dir: data/xxx1/raw
    speaker: speaker1
    spk_id: 0
    language: zh
    test_prefixes:
      - wav1
      - wav2
      - wav3
      - wav4
      - wav5
  - raw_data_dir: data/xxx2/raw
    speaker: speaker2
    spk_id: 1
    language: zh
    test_prefixes:
      - wav1
      - wav2
      - wav3
      - wav4
      - wav5

binary_data_dir: data/xxx/binary
binarization_args:
  num_workers: 0
pe: parselmouth
pe_ckpt: 'checkpoints/rmvpe/model.pt'
hnsep: vr
hnsep_ckpt: 'checkpoints/vr/model.pt'

use_lang_id: false
num_lang: 1
use_spk_id: false
num_spk: 1
# NOTICE: before enabling variance modules, please read the docs at
# https://github.com/openvpi/DiffSinger/tree/main/docs/BestPractices.md#mutual-influence-between-variance-modules
predict_dur: true
predict_pitch: false
# NOTICE: before enabling variance predictions, please read the docs at
# https://github.com/openvpi/DiffSinger/tree/main/docs/BestPractices.md#choosing-variance-parameters
predict_energy: false
predict_breathiness: true
predict_voicing: true
predict_tension: false

energy_db_min: -96.0
energy_db_max: -12.0

breathiness_db_min: -96.0
breathiness_db_max: -20.0

voicing_db_min: -96.0
voicing_db_max: -12.0

tension_logit_min: -10.0
tension_logit_max: 10.0

enc_ffn_kernel_size: 3
use_rope: true
rope_interleaved: false
use_stretch_embed: false
use_variance_scaling: true
hidden_size: 384
dur_prediction_args:
  arch: resnet
  hidden_size: 256
  dropout: 0.1
  num_layers: 5
  kernel_size: 3
  log_offset: 1.0
  loss_type: mse
  lambda_pdur_loss: 0.3
  lambda_wdur_loss: 1.0
  lambda_sdur_loss: 3.0

use_melody_encoder: true
melody_encoder_args:
  hidden_size: 128
  enc_layers: 4
use_glide_embed: false
glide_types: [up, down]
glide_embed_scale: 11.313708498984760  # sqrt(128)

diffusion_type: reflow

pitch_prediction_args:
  pitd_norm_min: -8.0
  pitd_norm_max: 8.0
  pitd_clip_min: -12.0
  pitd_clip_max: 12.0
  repeat_bins: 64
  backbone_type: 'lynxnet2'
  backbone_args:
    num_layers: 6
    num_channels: 512
    dropout_rate: 0.0
    use_conditioner_cache: true
    glu_type: 'atanglu'

variances_prediction_args:
  total_repeat_bins: 72
  backbone_type: 'lynxnet2'
  backbone_args:
    num_layers: 6
    num_channels: 384
    dropout_rate: 0.0
    use_conditioner_cache: true
    glu_type: 'atanglu'

lambda_dur_loss: 1.0
lambda_pitch_loss: 1.0
lambda_var_loss: 1.0

optimizer_args:
  optimizer_cls: torch.optim.AdamW
  lr: 0.0006
lr_scheduler_args:
  scheduler_cls: torch.optim.lr_scheduler.StepLR
  step_size: 5000
  gamma: 0.75
max_batch_frames: 80000
max_batch_size: 48
max_updates: 60000

num_valid_plots: 10
val_check_interval: 4000
num_ckpt_keep: 8
permanent_ckpt_start: 30000
permanent_ckpt_interval: 10000
pl_trainer_devices: 'auto'
pl_trainer_precision: '16-mixed'
