diff --git a/core.py b/core.py index 1fa04c55..a9c579c7 100644 --- a/core.py +++ b/core.py @@ -351,7 +351,9 @@ def run_tts_script( tts_script_path = os.path.join("rvc", "lib", "tools", "tts.py") - if os.path.exists(output_tts_path) and os.path.abspath(output_tts_path).startswith(os.path.abspath("assets")): + if os.path.exists(output_tts_path) and os.path.abspath(output_tts_path).startswith( + os.path.abspath("assets") + ): os.remove(output_tts_path) command_tts = [ diff --git a/rvc/lib/utils.py b/rvc/lib/utils.py index a03f25cf..2e6afdf8 100644 --- a/rvc/lib/utils.py +++ b/rvc/lib/utils.py @@ -86,9 +86,7 @@ def load_audio_infer( def format_title(title): - formatted_title = ( - unicodedata.normalize("NFC", title) - ) + formatted_title = unicodedata.normalize("NFC", title) formatted_title = re.sub(r"[\u2500-\u257F]+", "", formatted_title) formatted_title = re.sub(r"[^\w\s.-]", "", formatted_title, flags=re.UNICODE) formatted_title = re.sub(r"\s+", "_", formatted_title) diff --git a/tabs/inference/inference.py b/tabs/inference/inference.py index 8e1dd0c7..05b0c5ae 100644 --- a/tabs/inference/inference.py +++ b/tabs/inference/inference.py @@ -317,7 +317,9 @@ def create_folder_and_move_files(folder_name, bin_file, config_file): if bin_file: shutil.copy(bin_file, os.path.join(target_folder, os.path.basename(bin_file))) if config_file: - shutil.copy(config_file, os.path.join(target_folder, os.path.basename(config_file))) + shutil.copy( + config_file, os.path.join(target_folder, os.path.basename(config_file)) + ) return f"Files moved to folder {target_folder}" @@ -339,7 +341,9 @@ def refresh_embedders_folders(): def get_speakers_id(model): if model: try: - model_data = torch.load(os.path.join(now_dir, model), map_location="cpu", weights_only=True) + model_data = torch.load( + os.path.join(now_dir, model), map_location="cpu", weights_only=True + ) speakers_id = model_data.get("speakers_id") if speakers_id: return list(range(speakers_id)) @@ -2187,4 +2191,4 @@ def delay_visible(checkbox): fn=disable_stop_convert_button, inputs=[], outputs=[convert_button_batch, stop_button], - ) \ No newline at end of file + ) diff --git a/tabs/train/train.py b/tabs/train/train.py index 93cb234a..fb578f94 100644 --- a/tabs/train/train.py +++ b/tabs/train/train.py @@ -204,7 +204,9 @@ def create_folder_and_move_files(folder_name, bin_file, config_file): if bin_file: shutil.copy(bin_file, os.path.join(target_folder, os.path.basename(bin_file))) if config_file: - shutil.copy(config_file, os.path.join(target_folder, os.path.basename(config_file))) + shutil.copy( + config_file, os.path.join(target_folder, os.path.basename(config_file)) + ) return f"Files moved to folder {target_folder}" @@ -247,7 +249,9 @@ def refresh_pth_and_index_list(): # Export Pth and Index Files def export_pth(pth_path): allowed_paths = get_pth_list() - normalized_allowed_paths = [os.path.abspath(os.path.join(now_dir, p)) for p in allowed_paths] + normalized_allowed_paths = [ + os.path.abspath(os.path.join(now_dir, p)) for p in allowed_paths + ] normalized_pth_path = os.path.abspath(os.path.join(now_dir, pth_path)) if normalized_pth_path in normalized_allowed_paths: @@ -259,7 +263,9 @@ def export_pth(pth_path): def export_index(index_path): allowed_paths = get_index_list() - normalized_allowed_paths = [os.path.abspath(os.path.join(now_dir, p)) for p in allowed_paths] + normalized_allowed_paths = [ + os.path.abspath(os.path.join(now_dir, p)) for p in allowed_paths + ] normalized_index_path = os.path.abspath(os.path.join(now_dir, index_path)) if normalized_index_path in normalized_allowed_paths: