Skip to content

Commit

Permalink
remove all traces from v1 + improve filelist path
Browse files Browse the repository at this point in the history
  • Loading branch information
blaisewf committed Jan 6, 2025
1 parent 984223d commit cbf2952
Show file tree
Hide file tree
Showing 29 changed files with 81 additions and 437 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,4 @@
logs
env
venv
.venv
rvc/models
.venv
2 changes: 0 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
from core import run_prerequisites_script

run_prerequisites_script(
pretraineds_v1_f0=False,
pretraineds_v1_nof0=False,
pretraineds_v2_f0=True,
pretraineds_v2_nof0=False,
models=True,
Expand Down
8 changes: 3 additions & 5 deletions assets/Applio_NoUI.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,6 @@
"outputs": [],
"source": [
"# @title Extract Features\n",
"rvc_version = \"v2\" # @param [\"v2\", \"v1\"] {allow-input: false}\n",
"f0_method = \"rmvpe\" # @param [\"crepe\", \"crepe-tiny\", \"rmvpe\"] {allow-input: false}\n",
"hop_length = 128 # @param {type:\"slider\", min:1, max:512, step:0}\n",
"\n",
Expand All @@ -456,7 +455,7 @@
"embedder_model = \"contentvec\" # @param [\"contentvec\", \"chinese-hubert-base\", \"japanese-hubert-base\", \"korean-hubert-base\", \"custom\"] {allow-input: false}\n",
"embedder_model_custom = \"\" # @param {type:\"string\"}\n",
"\n",
"!python core.py extract --model_name \"{model_name}\" --rvc_version \"{rvc_version}\" --f0_method \"{f0_method}\" --hop_length \"{hop_length}\" --sample_rate \"{sr}\" --cpu_cores \"{cpu_cores}\" --gpu \"0\" --embedder_model \"{embedder_model}\" --embedder_model_custom \"{embedder_model_custom}\""
"!python core.py extract --model_name \"{model_name}\" --f0_method \"{f0_method}\" --hop_length \"{hop_length}\" --sample_rate \"{sr}\" --cpu_cores \"{cpu_cores}\" --gpu \"0\" --embedder_model \"{embedder_model}\" --embedder_model_custom \"{embedder_model_custom}\""
]
},
{
Expand Down Expand Up @@ -636,7 +635,7 @@
" if tensorboard == True:\n",
" %load_ext tensorboard\n",
" %tensorboard --logdir /content/Applio/logs/\n",
" !python core.py train --model_name \"{model_name}\" --rvc_version \"{rvc_version}\" --save_every_epoch \"{save_every_epoch}\" --save_only_latest \"{save_only_latest}\" --save_every_weights \"{save_every_weights}\" --total_epoch \"{total_epoch}\" --sample_rate \"{sr}\" --batch_size \"{batch_size}\" --gpu \"{gpu}\" --pretrained \"{pretrained}\" --custom_pretrained \"{custom_pretrained}\" --g_pretrained_path \"{g_pretrained_path}\" --d_pretrained_path \"{d_pretrained_path}\" --overtraining_detector \"{overtraining_detector}\" --overtraining_threshold \"{overtraining_threshold}\" --cleanup \"{cleanup}\" --cache_data_in_gpu \"{cache_data_in_gpu}\"\n",
" !python core.py train --model_name \"{model_name}\" --save_every_epoch \"{save_every_epoch}\" --save_only_latest \"{save_only_latest}\" --save_every_weights \"{save_every_weights}\" --total_epoch \"{total_epoch}\" --sample_rate \"{sr}\" --batch_size \"{batch_size}\" --gpu \"{gpu}\" --pretrained \"{pretrained}\" --custom_pretrained \"{custom_pretrained}\" --g_pretrained_path \"{g_pretrained_path}\" --d_pretrained_path \"{d_pretrained_path}\" --overtraining_detector \"{overtraining_detector}\" --overtraining_threshold \"{overtraining_threshold}\" --cleanup \"{cleanup}\" --cache_data_in_gpu \"{cache_data_in_gpu}\"\n",
"\n",
"\n",
"server_thread = threading.Thread(target=start_train)\n",
Expand All @@ -660,7 +659,7 @@
"source": [
"# @title Generate index file\n",
"index_algorithm = \"Auto\" # @param [\"Auto\", \"Faiss\", \"KMeans\"] {allow-input: false}\n",
"!python core.py index --model_name \"{model_name}\" --rvc_version \"{rvc_version}\" --index_algorithm \"{index_algorithm}\""
"!python core.py index --model_name \"{model_name}\" --index_algorithm \"{index_algorithm}\""
]
},
{
Expand Down Expand Up @@ -789,7 +788,6 @@
"# @markdown ### ➡️ Use the same as you did previously\n",
"model_name = \"Darwin\" # @param {type:\"string\"}\n",
"sample_rate = \"40k\" # @param [\"32k\", \"40k\", \"48k\"] {allow-input: false}\n",
"rvc_version = \"v2\" # @param [\"v2\", \"v1\"] {allow-input: false}\n",
"f0_method = \"rmvpe\" # @param [\"crepe\", \"crepe-tiny\", \"rmvpe\"] {allow-input: false}\n",
"hop_length = 128 # @param {type:\"slider\", min:1, max:512, step:0}\n",
"sr = int(sample_rate.rstrip(\"k\")) * 1000"
Expand Down
55 changes: 3 additions & 52 deletions core.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,6 @@ def run_preprocess_script(
# Extract
def run_extract_script(
model_name: str,
rvc_version: str,
f0_method: str,
hop_length: int,
cpu_cores: int,
Expand All @@ -479,7 +478,6 @@ def run_extract_script(
hop_length,
cpu_cores,
gpu,
rvc_version,
sample_rate,
embedder_model,
embedder_model_custom,
Expand All @@ -496,7 +494,6 @@ def run_extract_script(
# Train
def run_train_script(
model_name: str,
rvc_version: str,
save_every_epoch: int,
save_only_latest: bool,
save_every_weights: bool,
Expand All @@ -522,7 +519,7 @@ def run_train_script(

if custom_pretrained == False:
pg, pd = pretrained_selector(
str(rvc_version), str(vocoder), True, int(sample_rate)
str(vocoder), True, int(sample_rate)
)
else:
if g_pretrained_path is None or d_pretrained_path is None:
Expand All @@ -545,7 +542,6 @@ def run_train_script(
total_epoch,
pg,
pd,
rvc_version,
gpu,
batch_size,
sample_rate,
Expand All @@ -561,18 +557,17 @@ def run_train_script(
),
]
subprocess.run(command)
run_index_script(model_name, rvc_version, index_algorithm)
run_index_script(model_name, index_algorithm)
return f"Model {model_name} trained successfully."


# Index
def run_index_script(model_name: str, rvc_version: str, index_algorithm: str):
def run_index_script(model_name: str, index_algorithm: str):
index_script_path = os.path.join("rvc", "train", "process", "extract_index.py")
command = [
python,
index_script_path,
os.path.join(logs_path, model_name),
rvc_version,
index_algorithm,
]

Expand Down Expand Up @@ -607,16 +602,12 @@ def run_download_script(model_link: str):

# Prerequisites
def run_prerequisites_script(
pretraineds_v1_f0: bool,
pretraineds_v1_nof0: bool,
pretraineds_v2_f0: bool,
pretraineds_v2_nof0: bool,
models: bool,
exe: bool,
):
prequisites_download_pipeline(
pretraineds_v1_f0,
pretraineds_v1_nof0,
pretraineds_v2_f0,
pretraineds_v2_nof0,
models,
Expand Down Expand Up @@ -1893,13 +1884,6 @@ def parse_arguments():
extract_parser.add_argument(
"--model_name", type=str, help="Name of the model.", required=True
)
extract_parser.add_argument(
"--rvc_version",
type=str,
help="Version of the RVC model ('v1' or 'v2').",
choices=["v1", "v2"],
default="v2",
)
extract_parser.add_argument(
"--f0_method",
type=str,
Expand Down Expand Up @@ -1971,13 +1955,6 @@ def parse_arguments():
train_parser.add_argument(
"--model_name", type=str, help="Name of the model to be trained.", required=True
)
train_parser.add_argument(
"--rvc_version",
type=str,
help="Version of the RVC model to train ('v1' or 'v2').",
choices=["v1", "v2"],
default="v2",
)
train_parser.add_argument(
"--vocoder",
type=str,
Expand Down Expand Up @@ -2113,13 +2090,6 @@ def parse_arguments():
index_parser.add_argument(
"--model_name", type=str, help="Name of the model.", required=True
)
index_parser.add_argument(
"--rvc_version",
type=str,
help="Version of the RVC model ('v1' or 'v2').",
choices=["v1", "v2"],
default="v2",
)
index_parser.add_argument(
"--index_algorithm",
type=str,
Expand Down Expand Up @@ -2181,27 +2151,13 @@ def parse_arguments():
prerequisites_parser = subparsers.add_parser(
"prerequisites", help="Install prerequisites for RVC."
)
prerequisites_parser.add_argument(
"--pretraineds_v1_f0",
type=lambda x: bool(strtobool(x)),
choices=[True, False],
default=False,
help="Download pretrained models for RVC v1.",
)
prerequisites_parser.add_argument(
"--pretraineds_v2_f0",
type=lambda x: bool(strtobool(x)),
choices=[True, False],
default=True,
help="Download pretrained models for RVC v2.",
)
prerequisites_parser.add_argument(
"--pretraineds_v1_nof0",
type=lambda x: bool(strtobool(x)),
choices=[True, False],
default=False,
help="Download non f0 pretrained models for RVC v1.",
)
prerequisites_parser.add_argument(
"--pretraineds_v2_nof0",
type=lambda x: bool(strtobool(x)),
Expand Down Expand Up @@ -2412,7 +2368,6 @@ def main():
elif args.mode == "extract":
run_extract_script(
model_name=args.model_name,
rvc_version=args.rvc_version,
f0_method=args.f0_method,
hop_length=args.hop_length,
cpu_cores=args.cpu_cores,
Expand All @@ -2425,7 +2380,6 @@ def main():
elif args.mode == "train":
run_train_script(
model_name=args.model_name,
rvc_version=args.rvc_version,
save_every_epoch=args.save_every_epoch,
save_only_latest=args.save_only_latest,
save_every_weights=args.save_every_weights,
Expand All @@ -2448,7 +2402,6 @@ def main():
elif args.mode == "index":
run_index_script(
model_name=args.model_name,
rvc_version=args.rvc_version,
index_algorithm=args.index_algorithm,
)
elif args.mode == "model_information":
Expand All @@ -2470,8 +2423,6 @@ def main():
)
elif args.mode == "prerequisites":
run_prerequisites_script(
pretraineds_v1_f0=args.pretraineds_v1_f0,
pretraineds_v1_nof0=args.pretraineds_v1_nof0,
pretraineds_v2_f0=args.pretraineds_v2_f0,
pretraineds_v2_nof0=args.pretraineds_v2_nof0,
models=args.models,
Expand Down
Binary file removed logs/mute/v1_extracted/mute.npy
Binary file not shown.
Binary file removed logs/mute/v2_extracted/mute.npy
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 4 additions & 8 deletions rvc/configs/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,10 @@
import os

version_config_paths = [
os.path.join("v1", "32000.json"),
os.path.join("v1", "40000.json"),
os.path.join("v1", "44100.json"),
os.path.join("v1", "48000.json"),
os.path.join("v2", "48000.json"),
os.path.join("v2", "40000.json"),
os.path.join("v2", "44100.json"),
os.path.join("v2", "32000.json"),
os.path.join("48000.json"),
os.path.join("40000.json"),
os.path.join("44100.json"),
os.path.join("32000.json"),
]


Expand Down
47 changes: 0 additions & 47 deletions rvc/configs/v1/32000.json

This file was deleted.

47 changes: 0 additions & 47 deletions rvc/configs/v1/40000.json

This file was deleted.

Loading

0 comments on commit cbf2952

Please sign in to comment.