Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(format): run black on main #966

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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