Skip to content

Commit

Permalink
many bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
prophesier committed Nov 21, 2022
1 parent dc3a824 commit b057f1f
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 26 deletions.
2 changes: 0 additions & 2 deletions infer_tools/infer_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ def __init__(self, project_name, config_name, hubert_gpu, model_path):
self.load_ckpt()
self.model.cuda()
hparams['hubert_gpu'] = hubert_gpu
hparams['use_uv'] = True
self.hubert = Hubertencoder(hparams['hubert_path'])
self.pe = PitchExtractor().cuda()
utils.load_ckpt(self.pe, hparams['pe_ckpt'], 'model', strict=True)
Expand Down Expand Up @@ -151,7 +150,6 @@ def diff_infer():
batch['mel2ph_pred'] = outputs['mel2ph']
batch['f0_gt'] = denorm_f0(batch['f0'], batch['uv'], hparams)
if use_pe:
hparams['use_uv'] = True
batch['f0_pred'] = self.pe(outputs['mel_out'])['f0_denorm_pred'].detach()
else:
batch['f0_pred'] = outputs.get('f0_denorm')
Expand Down
40 changes: 20 additions & 20 deletions inference.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion modules/fastspeech/pe.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def forward(self, mel_input=None):
ret['pitch_pred'] = pitch_pred = self.pitch_predictor(mel_hidden)

pitch_padding = mel_input.abs().sum(-1) == 0
use_uv = hparams['pitch_type'] == 'frame' and hparams['use_uv']
use_uv = hparams['pitch_type'] == 'frame' #and hparams['use_uv']
ret['f0_denorm_pred'] = denorm_f0(
pitch_pred[:, :, 0], (pitch_pred[:, :, 1] > 0) if use_uv else None,
hparams, pitch_padding=pitch_padding)
Expand Down
2 changes: 1 addition & 1 deletion preprocessing/hubertinfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def __init__(self, pt_path='checkpoints/hubert/hubert_soft.pt'):
else:
self.use_gpu = True
self.dev = torch.device("cuda" if self.use_gpu and torch.cuda.is_available() else "cpu")
self.hbt_model = hubert_soft(str(pt_path))
self.hbt_model = hubert_soft(str(pt_path)).to(self.dev)

def encode(self, wav_path):
if isinstance(wav_path, BytesIO):
Expand Down
Binary file modified test_output.wav
Binary file not shown.
2 changes: 1 addition & 1 deletion training/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ use_pos_embed: true
use_spk_embed: false
use_spk_id: false
use_split_spk_id: false
use_uv: true
use_uv: false
use_vec: false
use_var_enc: false
val_check_interval: 2000
Expand Down
2 changes: 1 addition & 1 deletion training/config_nsf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ use_pos_embed: true
use_spk_embed: false
use_spk_id: false
use_split_spk_id: false
use_uv: true
use_uv: false
use_vec: false
use_var_enc: false
val_check_interval: 2000
Expand Down

0 comments on commit b057f1f

Please sign in to comment.