Skip to content

Commit 36cf158

Browse files
update readme/requirements & clean some unnecessary codes.
1 parent ce7abdc commit 36cf158

File tree

6 files changed

+14
-32
lines changed

6 files changed

+14
-32
lines changed

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# DiffSinger: Singing Voice Synthesis via Shallow Diffusion Mechanism
22
[![arXiv](https://img.shields.io/badge/arXiv-Paper-<COLOR>.svg)](https://arxiv.org/abs/2105.02446)
3+
[![GitHub Stars](https://img.shields.io/github/stars/MoonInTheRiver/DiffSinger?style=social)](https://github.com/MoonInTheRiver/DiffSinger)
34

45
This repository is the official PyTorch implementation of our AAAI-2022 [paper](https://arxiv.org/abs/2105.02446), in which we propose DiffSinger (for Singing-Voice-Synthesis) and DiffSpeech (for Text-to-Speech).
56

@@ -46,14 +47,14 @@ CUDA_VISIBLE_DEVICES=0 python data_gen/tts/bin/binarize.py --config configs/tts/
4647
### 2. Training Example
4748

4849
```sh
49-
CUDA_VISIBLE_DEVICES=0 python tasks/run.py --config usr/configs/lj_ds_beta6.yaml --exp_name xxx --reset
50+
CUDA_VISIBLE_DEVICES=0 python tasks/run.py --config usr/configs/lj_ds_beta6.yaml --exp_name lj_exp1 --reset
5051
```
5152

5253

5354
### 3. Inference Example
5455

5556
```sh
56-
CUDA_VISIBLE_DEVICES=0 python tasks/run.py --config usr/configs/lj_ds_beta6.yaml --exp_name xxx --reset --infer
57+
CUDA_VISIBLE_DEVICES=0 python tasks/run.py --config usr/configs/lj_ds_beta6.yaml --exp_name lj_exp1 --reset --infer
5758
```
5859

5960
We also provide:
@@ -78,13 +79,13 @@ Similar to DiffSpeech.
7879

7980
### 2. Training Example
8081
```sh
81-
CUDA_VISIBLE_DEVICES=0 python tasks/run.py --config usr/configs/popcs_ds_beta6.yaml --exp_name xxx --reset
82+
CUDA_VISIBLE_DEVICES=0 python tasks/run.py --config usr/configs/popcs_ds_beta6.yaml --exp_name popcs_exp1 --reset
8283
# or
83-
CUDA_VISIBLE_DEVICES=0 python tasks/run.py --config usr/configs/popcs_ds_beta6_offline.yaml --exp_name xxx --reset
84+
CUDA_VISIBLE_DEVICES=0 python tasks/run.py --config usr/configs/popcs_ds_beta6_offline.yaml --exp_name popcs_exp2 --reset
8485
```
8586
### 3. Inference Example
8687
```sh
87-
CUDA_VISIBLE_DEVICES=0 python tasks/run.py --config xxx --exp_name xxx --reset --infer
88+
CUDA_VISIBLE_DEVICES=0 python tasks/run.py --config usr/configs/popcs_ds_beta6_offline.yaml --exp_name popcs_exp2 --reset --infer
8889
```
8990
The pre-trained model for SVS will be provided recently.
9091
<!--

configs/config_base.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ sort_by_len: true
2525
#########
2626
load_ckpt: ''
2727
save_ckpt: true
28-
save_best: true
28+
save_best: false
2929
num_ckpt_keep: 3
3030
clip_grad_norm: 0
3131
accumulate_grad_batches: 1

requirements_3090.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ packaging==21.2
3535
pandas==1.3.4
3636
Pillow==8.4.0
3737
pooch==1.5.2
38-
praat-parselmouth==0.4.0
38+
praat-parselmouth==0.3.3
3939
proglog==0.1.9
4040
protobuf==3.19.1
4141
pycparser==2.20

tasks/tts/fs2.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -283,12 +283,7 @@ def test_step(self, sample, batch_idx):
283283
mel2ph, uv, f0 = None, None, None
284284
ref_mels = None
285285
if hparams['profile_infer']:
286-
if batch_idx % 10 == 0:
287-
torch.cuda.empty_cache()
288-
mel2ph, uv, f0 = sample['mel2ph'], sample['uv'], sample['f0']
289-
with utils.Timer('fs', print_time=True):
290-
self.model(
291-
txt_tokens, mel2ph=mel2ph, spk_embed=spk_embed, f0=f0, uv=uv, ref_mels=ref_mels, infer=True)
286+
pass
292287
else:
293288
if hparams['use_gt_dur']:
294289
mel2ph = sample['mel2ph']

usr/diffsinger_task.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def validation_step(self, sample, batch_idx):
6060
outputs = utils.tensors_to_scalars(outputs)
6161
if batch_idx < hparams['num_valid_plots']:
6262
model_out = self.model(
63-
txt_tokens, spk_embed=spk_embed, mel2ph=mel2ph, f0=f0, uv=uv, energy=energy, ref_mels=target, infer=True)
63+
txt_tokens, spk_embed=spk_embed, mel2ph=mel2ph, f0=f0, uv=uv, energy=energy, ref_mels=None, infer=True)
6464
gt_f0 = denorm_f0(sample['f0'], sample['uv'], hparams)
6565
self.plot_wav(batch_idx, sample['mels'], model_out['mel_out'], is_mel=True, gt_f0=gt_f0, f0=model_out.get('f0_denorm'))
6666
self.plot_mel(batch_idx, sample['mels'], model_out['mel_out'], name=f'diffmel_{batch_idx}')
@@ -164,7 +164,7 @@ def validation_step(self, sample, batch_idx):
164164
fs2_mel = sample['fs2_mels']
165165
model_out = self.model(
166166
txt_tokens, spk_embed=spk_embed, mel2ph=mel2ph, f0=f0, uv=uv, energy=energy,
167-
ref_mels=[target, fs2_mel], infer=True)
167+
ref_mels=[None, fs2_mel], infer=True)
168168
gt_f0 = denorm_f0(sample['f0'], sample['uv'], hparams)
169169
self.plot_wav(batch_idx, sample['mels'], model_out['mel_out'], is_mel=True, gt_f0=gt_f0, f0=model_out.get('f0_denorm'))
170170
self.plot_mel(batch_idx, sample['mels'], model_out['mel_out'], name=f'diffmel_{batch_idx}')
@@ -176,14 +176,7 @@ def test_step(self, sample, batch_idx):
176176
txt_tokens = sample['txt_tokens']
177177
energy = sample['energy']
178178
if hparams['profile_infer']:
179-
print(sample['item_name'])
180-
if batch_idx % 10 == 0:
181-
torch.cuda.empty_cache()
182-
mel2ph, uv, f0 = sample['mel2ph'], sample['uv'], sample['f0']
183-
target = sample['mels'] # [B, T_s, 80]
184-
with utils.Timer('diffsinger', print_time=True):
185-
self.model(
186-
txt_tokens, mel2ph=mel2ph, spk_embed=spk_embed, f0=f0, uv=uv, ref_mels=target, infer=True)
179+
pass
187180
else:
188181
mel2ph, uv, f0 = None, None, None
189182
if hparams['use_gt_dur']:

usr/diffspeech_task.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,7 @@ def test_step(self, sample, batch_idx):
116116
mel2ph, uv, f0 = None, None, None
117117
energy = sample['energy']
118118
if hparams['profile_infer']:
119-
print(sample['item_name'])
120-
if batch_idx % 10 == 0:
121-
torch.cuda.empty_cache()
122-
mel2ph, uv, f0 = sample['mel2ph'], sample['uv'], sample['f0']
123-
target = sample['mels'] # [B, T_s, 80]
124-
with utils.Timer('diffspeech', print_time=True):
125-
self.model(
126-
txt_tokens, mel2ph=mel2ph, spk_embed=spk_embed, f0=f0, uv=uv, ref_mels=target, infer=True)
119+
pass
127120
else:
128121
mel2ph, uv, f0 = None, None, None
129122
if hparams['use_gt_dur']:
@@ -134,7 +127,7 @@ def test_step(self, sample, batch_idx):
134127
target = sample['mels'] # [B, T_s, 80]
135128
# fs2_mel = sample['fs2_mels']
136129
outputs = self.model(
137-
txt_tokens, spk_embed=spk_embed, mel2ph=mel2ph, f0=f0, uv=uv, ref_mels=target, energy=energy, infer=True)
130+
txt_tokens, spk_embed=spk_embed, mel2ph=mel2ph, f0=f0, uv=uv, ref_mels=None, energy=energy, infer=True)
138131
sample['outputs'] = self.model.out2mel(outputs['mel_out'])
139132
sample['mel2ph_pred'] = outputs['mel2ph']
140133

0 commit comments

Comments
 (0)