From 5f44a191ba7b3386a0f79571f9c99db1014cd597 Mon Sep 17 00:00:00 2001 From: Politrees <143968312+Bebra777228@users.noreply.github.com> Date: Sun, 29 Dec 2024 01:43:15 +0500 Subject: [PATCH 1/2] Update code_formatter.yml --- .github/workflows/code_formatter.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/code_formatter.yml b/.github/workflows/code_formatter.yml index 4018b926c..bb44b59e6 100644 --- a/.github/workflows/code_formatter.yml +++ b/.github/workflows/code_formatter.yml @@ -23,11 +23,13 @@ jobs: with: python-version: ${{ matrix.python-version }} - - name: Install Black - run: pip install "black[jupyter]" + - name: Install Black and autoflake + run: pip install "black[jupyter]" autoflake + + - name: Run autoflake + run: autoflake --in-place --recursive . - name: Run Black - # run: black $(git ls-files '*.py') run: black . --exclude=".*\.ipynb$" - name: Commit Back From 1b42d1d9838617f36a602c35ea780d16bc02db81 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 28 Dec 2024 20:43:31 +0000 Subject: [PATCH 2/2] chore(format): run black on main --- assets/themes/Applio.py | 1 - rvc/train/extract/extract.py | 2 -- rvc/train/train.py | 11 ++++------- tabs/voice_blender/voice_blender.py | 1 - 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/assets/themes/Applio.py b/assets/themes/Applio.py index 0f7b6c882..093458d70 100644 --- a/assets/themes/Applio.py +++ b/assets/themes/Applio.py @@ -6,7 +6,6 @@ # gr.themes.builder() from gradio.themes.base import Base from gradio.themes.utils import colors, fonts, sizes -import time class Applio(Base): diff --git a/rvc/train/extract/extract.py b/rvc/train/extract/extract.py index 288547a93..124ff0fb5 100644 --- a/rvc/train/extract/extract.py +++ b/rvc/train/extract/extract.py @@ -9,8 +9,6 @@ import concurrent.futures import multiprocessing as mp import json -import shutil -from distutils.util import strtobool now_dir = os.getcwd() sys.path.append(os.path.join(now_dir)) diff --git a/rvc/train/train.py b/rvc/train/train.py index 2dae07ea9..ecee8be16 100644 --- a/rvc/train/train.py +++ b/rvc/train/train.py @@ -1,17 +1,14 @@ import os -import re import sys import glob import json import torch import datetime -import math from collections import deque from distutils.util import strtobool from random import randint, shuffle from time import time as ttime -from time import sleep from tqdm import tqdm import numpy as np from torch.nn.parallel import DistributedDataParallel as DDP @@ -178,8 +175,8 @@ def main(): if torch.cuda.is_available(): device = torch.device("cuda") - gpus = [int(item) for item in gpus.split('-')] - n_gpus = len(gpus) + gpus = [int(item) for item in gpus.split("-")] + n_gpus = len(gpus) elif torch.backends.mps.is_available(): device = torch.device("mps") gpus = [0] @@ -384,7 +381,7 @@ def run( vocoder=vocoder, checkpointing=checkpointing, ) - + net_d = MultiPeriodDiscriminator( version, config.model.use_spectral_norm, checkpointing=checkpointing ) @@ -503,7 +500,7 @@ def run( pitch.cuda(device_id, non_blocking=True), pitchf.cuda(device_id, non_blocking=True), sid.cuda(device_id, non_blocking=True), - ) + ) else: reference = ( phone.to(device), diff --git a/tabs/voice_blender/voice_blender.py b/tabs/voice_blender/voice_blender.py index b90b86ab3..954332a80 100644 --- a/tabs/voice_blender/voice_blender.py +++ b/tabs/voice_blender/voice_blender.py @@ -1,6 +1,5 @@ import os, sys import gradio as gr -import shutil now_dir = os.getcwd() sys.path.append(now_dir)