Skip to content

Commit

Permalink
Merge pull request #733 from IAHispano/formatter/main
Browse files Browse the repository at this point in the history
chore(format): run black on main
  • Loading branch information
blaisewf authored Sep 23, 2024
2 parents 81f6d2a + 1b4dd52 commit 9505e46
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
22 changes: 16 additions & 6 deletions rvc/train/extract/preparing_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,26 @@ def generate_filelist(
mute_base_path = os.path.join(current_directory, "logs", "mute")

for name in names:
options.append(f"{gt_wavs_dir}/{name}.wav|{feature_dir}/{name}.npy|{f0_dir}/{name}.wav.npy|{f0nsf_dir}/{name}.wav.npy|0")

mute_audio_path = os.path.join(mute_base_path, "sliced_audios", f"mute{sample_rate}.wav")
mute_feature_path = os.path.join(mute_base_path, f"{rvc_version}_extracted", "mute.npy")
options.append(
f"{gt_wavs_dir}/{name}.wav|{feature_dir}/{name}.npy|{f0_dir}/{name}.wav.npy|{f0nsf_dir}/{name}.wav.npy|0"
)

mute_audio_path = os.path.join(
mute_base_path, "sliced_audios", f"mute{sample_rate}.wav"
)
mute_feature_path = os.path.join(
mute_base_path, f"{rvc_version}_extracted", "mute.npy"
)
mute_f0_path = os.path.join(mute_base_path, "f0", "mute.wav.npy")
mute_f0nsf_path = os.path.join(mute_base_path, "f0_voiced", "mute.wav.npy")

# always adding two files
options.append(f"{mute_audio_path}|{mute_feature_path}|{mute_f0_path}|{mute_f0nsf_path}|0")
options.append(f"{mute_audio_path}|{mute_feature_path}|{mute_f0_path}|{mute_f0nsf_path}|0")
options.append(
f"{mute_audio_path}|{mute_feature_path}|{mute_f0_path}|{mute_f0nsf_path}|0"
)
options.append(
f"{mute_audio_path}|{mute_feature_path}|{mute_f0_path}|{mute_f0nsf_path}|0"
)

shuffle(options)

Expand Down
5 changes: 3 additions & 2 deletions rvc/train/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ def run(
config.data.filter_length // 2 + 1,
config.train.segment_size // config.data.hop_length,
**config.model,
use_f0=pitch_guidance==True, # converting 1/0 to True/False
use_f0=pitch_guidance == True, # converting 1/0 to True/False
is_half=config.train.fp16_run and device.type == "cuda",
sr=sample_rate,
).to(device)
Expand Down Expand Up @@ -926,7 +926,8 @@ def train_and_evaluate(
extract_model(
ckpt=ckpt,
sr=sample_rate,
pitch_guidance=pitch_guidance==True, # converting 1/0 to True/False,
pitch_guidance=pitch_guidance
== True, # converting 1/0 to True/False,
name=model_name,
model_dir=m,
epoch=epoch,
Expand Down

0 comments on commit 9505e46

Please sign in to comment.