Skip to content

Commit

Permalink
Merge pull request #934 from Bebra777228/main
Browse files Browse the repository at this point in the history
Adding autoflake to workflows
  • Loading branch information
blaisewf authored Dec 28, 2024
2 parents b4a5711 + 8d9d0d2 commit 4474e16
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 14 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/code_formatter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion assets/themes/Applio.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 0 additions & 2 deletions rvc/train/extract/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
11 changes: 4 additions & 7 deletions rvc/train/train.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -384,7 +381,7 @@ def run(
vocoder=vocoder,
checkpointing=checkpointing,
)

net_d = MultiPeriodDiscriminator(
version, config.model.use_spectral_norm, checkpointing=checkpointing
)
Expand Down Expand Up @@ -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),
Expand Down
1 change: 0 additions & 1 deletion tabs/voice_blender/voice_blender.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import os, sys
import gradio as gr
import shutil

now_dir = os.getcwd()
sys.path.append(now_dir)
Expand Down

0 comments on commit 4474e16

Please sign in to comment.