From 64d51a05f588087e4df8d809e5a99d7dbbc62d9f Mon Sep 17 00:00:00 2001 From: blaisewf Date: Tue, 7 Jan 2025 13:10:31 +0100 Subject: [PATCH] remove old precision settings --- rvc/configs/32000.json | 1 - rvc/configs/40000.json | 1 - rvc/configs/44100.json | 1 - rvc/configs/48000.json | 1 - rvc/configs/config.py | 34 ------------------------ tabs/settings/sections/precision.py | 41 ----------------------------- tabs/settings/settings.py | 4 +-- 7 files changed, 1 insertion(+), 82 deletions(-) delete mode 100644 tabs/settings/sections/precision.py diff --git a/rvc/configs/32000.json b/rvc/configs/32000.json index eabab7b53..803a948e9 100644 --- a/rvc/configs/32000.json +++ b/rvc/configs/32000.json @@ -5,7 +5,6 @@ "learning_rate": 1e-4, "betas": [0.8, 0.99], "eps": 1e-9, - "fp16_run": true, "lr_decay": 0.999875, "segment_size": 12800, "c_mel": 45, diff --git a/rvc/configs/40000.json b/rvc/configs/40000.json index e1ba44a9c..dd9bcc85b 100644 --- a/rvc/configs/40000.json +++ b/rvc/configs/40000.json @@ -5,7 +5,6 @@ "learning_rate": 1e-4, "betas": [0.8, 0.99], "eps": 1e-9, - "fp16_run": true, "lr_decay": 0.999875, "segment_size": 12800, "c_mel": 45, diff --git a/rvc/configs/44100.json b/rvc/configs/44100.json index dd1e57b21..76ebbaef4 100644 --- a/rvc/configs/44100.json +++ b/rvc/configs/44100.json @@ -5,7 +5,6 @@ "learning_rate": 0.0001, "betas": [0.8, 0.99], "eps": 1e-09, - "fp16_run": true, "lr_decay": 0.999875, "segment_size": 15876, "c_mel": 45, diff --git a/rvc/configs/48000.json b/rvc/configs/48000.json index 1a4da9f5c..968ad3b3b 100644 --- a/rvc/configs/48000.json +++ b/rvc/configs/48000.json @@ -5,7 +5,6 @@ "learning_rate": 1e-4, "betas": [0.8, 0.99], "eps": 1e-9, - "fp16_run": true, "lr_decay": 0.999875, "segment_size": 17280, "c_mel": 45, diff --git a/rvc/configs/config.py b/rvc/configs/config.py index 7f568eedb..dcccf29a4 100644 --- a/rvc/configs/config.py +++ b/rvc/configs/config.py @@ -42,40 +42,6 @@ def load_config_json(self): configs[config_file] = json.load(f) return configs - def set_precision(self, precision): - if precision not in ["fp32", "fp16"]: - raise ValueError("Invalid precision type. Must be 'fp32' or 'fp16'.") - - fp16_run_value = precision == "fp16" - - for config_path in version_config_paths: - full_config_path = os.path.join("rvc", "configs", config_path) - try: - with open(full_config_path, "r") as f: - config = json.load(f) - config["train"]["fp16_run"] = fp16_run_value - with open(full_config_path, "w") as f: - json.dump(config, f, indent=4) - except FileNotFoundError: - print(f"File not found: {full_config_path}") - - return f"Overwritten config to use {precision}." - - def get_precision(self): - if not version_config_paths: - raise FileNotFoundError("No configuration paths provided.") - - full_config_path = os.path.join("rvc", "configs", version_config_paths[0]) - try: - with open(full_config_path, "r") as f: - config = json.load(f) - fp16_run_value = config["train"].get("fp16_run", False) - precision = "fp16" if fp16_run_value else "fp32" - return precision - except FileNotFoundError: - print(f"File not found: {full_config_path}") - return None - def device_config(self): if self.device.startswith("cuda"): self.set_cuda_config() diff --git a/tabs/settings/sections/precision.py b/tabs/settings/sections/precision.py deleted file mode 100644 index 23e41d133..000000000 --- a/tabs/settings/sections/precision.py +++ /dev/null @@ -1,41 +0,0 @@ -import gradio as gr - -from rvc.configs.config import Config - -config = Config() - -from assets.i18n.i18n import I18nAuto - -i18n = I18nAuto() - - -def precision_tab(): - with gr.Row(): - with gr.Column(): - - precision = gr.Radio( - label=i18n("Precision"), - info=i18n( - "Select the precision you want to use for training and inference." - ), - choices=[ - "fp16", - "fp32", - ], - value=config.get_precision(), - interactive=True, - ) - precision_output = gr.Textbox( - label=i18n("Output Information"), - info=i18n("The output information will be displayed here."), - value="", - max_lines=8, - interactive=False, - ) - - update_button = gr.Button(i18n("Update precision")) - update_button.click( - fn=config.set_precision, - inputs=[precision], - outputs=[precision_output], - ) diff --git a/tabs/settings/settings.py b/tabs/settings/settings.py index 85473274a..3b54cf105 100644 --- a/tabs/settings/settings.py +++ b/tabs/settings/settings.py @@ -6,7 +6,6 @@ sys.path.append(now_dir) from tabs.settings.sections.presence import presence_tab -from tabs.settings.sections.precision import precision_tab from tabs.settings.sections.themes import theme_tab from tabs.settings.sections.version import version_tab from tabs.settings.sections.lang import lang_tab @@ -21,6 +20,5 @@ def settings_tab(): version_tab() lang_tab() restart_tab() - with gr.TabItem(label="Inference & Training"): - precision_tab() + with gr.TabItem(label="Training"): model_author_tab()