Skip to content

Commit

Permalink
chore(format): run black on main
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Feb 1, 2025
1 parent bef10df commit 40360fc
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
4 changes: 3 additions & 1 deletion core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
10 changes: 7 additions & 3 deletions tabs/inference/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

Expand All @@ -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))
Expand Down Expand Up @@ -2187,4 +2191,4 @@ def delay_visible(checkbox):
fn=disable_stop_convert_button,
inputs=[],
outputs=[convert_button_batch, stop_button],
)
)
12 changes: 9 additions & 3 deletions tabs/train/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down

0 comments on commit 40360fc

Please sign in to comment.