Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
blaisewf committed Jan 21, 2024
1 parent 632ce60 commit 5a60a26
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 13 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
logs
*.exe
*.pt
rvc/pretraineds

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
6 changes: 3 additions & 3 deletions core.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ def parse_arguments():
infer_parser.add_argument(
"f0up_key",
type=validate_f0up_key,
help="Value for f0up_key (-12 to +12)",
help="Value for f0up_key (-24 to +24)",
)
infer_parser.add_argument(
"filter_radius",
Expand Down Expand Up @@ -391,7 +391,7 @@ def parse_arguments():
batch_infer_parser.add_argument(
"f0up_key",
type=validate_f0up_key,
help="Value for f0up_key (-12 to +12)",
help="Value for f0up_key (-24 to +24)",
)
batch_infer_parser.add_argument(
"filter_radius",
Expand Down Expand Up @@ -443,7 +443,7 @@ def parse_arguments():
tts_parser.add_argument(
"f0up_key",
type=validate_f0up_key,
help="Value for f0up_key (-12 to +12)",
help="Value for f0up_key (-24 to +24)",
)
tts_parser.add_argument(
"filter_radius",
Expand Down
4 changes: 2 additions & 2 deletions rvc/lib/tools/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ def validate_sampling_rate(value):

def validate_f0up_key(value):
f0up_key = int(value)
if -12 <= f0up_key <= 12:
if -24 <= f0up_key <= 24:
return f0up_key
else:
raise argparse.ArgumentTypeError(f"f0up_key must be in the range of -12 to +12")
raise argparse.ArgumentTypeError(f"f0up_key must be in the range of -24 to +24")

def validate_true_false(value):
valid_tf = [
Expand Down
28 changes: 24 additions & 4 deletions tabs/inference/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@
os.path.join(root, file)
for root, _, files in os.walk(model_root, topdown=False)
for file in files
if file.endswith((".pth", ".onnx"))
if (
file.endswith((".pth", ".onnx"))
and not (file.startswith("G_") or file.startswith("D_"))
)
]

indexes_list = [
Expand Down Expand Up @@ -73,7 +76,10 @@ def change_choices():
os.path.join(root, file)
for root, _, files in os.walk(model_root, topdown=False)
for file in files
if file.endswith((".pth", ".onnx"))
if (
file.endswith((".pth", ".onnx"))
and not (file.startswith("G_") or file.startswith("D_"))
)
]

indexes_list = [
Expand Down Expand Up @@ -262,7 +268,14 @@ def inference_tab():
value=False,
interactive=True,
)
pitch = gr.Slider(-12, 12, 0, label=i18n("Pitch"))
pitch = gr.Slider(
minimum=-24,
maximum=24,
step=1,
label=i18n("Pitch"),
value=0,
interactive=True,
)
filter_radius = gr.Slider(
minimum=0,
maximum=7,
Expand Down Expand Up @@ -330,7 +343,14 @@ def inference_tab():
clear_outputs = gr.Button(
i18n("Clear Outputs (Deletes all audios in assets/audios)")
)
pitch_batch = gr.Slider(-12, 12, 0, label=i18n("Pitch"))
pitch_batch = gr.Slider(
minimum=-24,
maximum=24,
step=1,
label=i18n("Pitch"),
value=0,
interactive=True,
)
filter_radius_batch = gr.Slider(
minimum=0,
maximum=7,
Expand Down
19 changes: 16 additions & 3 deletions tabs/tts/tts.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@
os.path.join(root, file)
for root, _, files in os.walk(model_root, topdown=False)
for file in files
if file.endswith((".pth", ".onnx"))
if (
file.endswith((".pth", ".onnx"))
and not (file.startswith("G_") or file.startswith("D_"))
)
]

indexes_list = [
Expand All @@ -64,7 +67,10 @@ def change_choices():
os.path.join(root, file)
for root, _, files in os.walk(model_root, topdown=False)
for file in files
if file.endswith((".pth", ".onnx"))
if (
file.endswith((".pth", ".onnx"))
and not (file.startswith("G_") or file.startswith("D_"))
)
]

indexes_list = [
Expand Down Expand Up @@ -251,7 +257,14 @@ def tts_tab():
interactive=True,
)

pitch = gr.Slider(-12, 12, 0, label=i18n("Pitch"))
pitch = gr.Slider(
minimum=-24,
maximum=24,
step=1,
label=i18n("Pitch"),
value=0,
interactive=True,
)
filter_radius = gr.Slider(
minimum=0,
maximum=7,
Expand Down

0 comments on commit 5a60a26

Please sign in to comment.