Skip to content

Commit b6777f0

Browse files
authored
Автоматическое форматирование кода
Automatic code formatting
2 parents d8a4dba + 018d321 commit b6777f0

6 files changed

Lines changed: 19 additions & 15 deletions

File tree

app.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,12 @@
1010
from typing import Any
1111

1212
import gradio as gr
13+
from PolUVR.utils import PolUVR_UI
1314

14-
from tabs.inference import inference_tab, edge_tts_tab
15+
from tabs.inference import edge_tts_tab, inference_tab
1516
from tabs.install import files_upload, install_hubert_tab, output_message, url_zip_download, zip_upload
1617
from tabs.welcome import welcome_tab
1718

18-
from PolUVR.utils import PolUVR_UI
19-
20-
2119
DEFAULT_SERVER_NAME = "127.0.0.1"
2220
DEFAULT_PORT = 4000
2321
MAX_PORT_ATTEMPTS = 10

assets/model_installer.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import os
22

33
import requests
4-
54
from tqdm import tqdm
65

76
PREDICTORS = "https://huggingface.co/Politrees/RVC_resources/resolve/main/predictors/"
@@ -24,12 +23,12 @@ def dl_model(link, model_name, dir_name):
2423
r.raise_for_status()
2524

2625
# Получаем общий размер файла
27-
total_size = int(r.headers.get('content-length', 0))
26+
total_size = int(r.headers.get("content-length", 0))
2827
# Используем tqdm для отображения прогресса
2928
with open(file_path, "wb") as f, tqdm(
3029
desc=f"Установка {model_name}",
3130
total=total_size,
32-
unit='iB',
31+
unit="iB",
3332
unit_scale=True,
3433
unit_divisor=1024,
3534
) as bar:

rvc/infer/infer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
def display_progress(percent, message, progress=gr.Progress()):
3333
progress(percent, desc=message)
3434

35+
3536
def print_display_progress(percent, message, progress=gr.Progress()):
3637
print(message)
3738
progress(percent, desc=message)
@@ -164,7 +165,7 @@ def rvc_infer(
164165
base_name = os.path.splitext(os.path.basename(input_path))[0]
165166
if len(base_name) > 50:
166167
gr.Warning("Имя файла превышает 50 символов и будет сокращено для удобства использования.")
167-
base_name = "Made_in_PolGen" # Сменить имя файла, если длина исходного более 50 символов
168+
base_name = "Made_in_PolGen" # Сменить имя файла, если длина исходного более 50 символов
168169
output_path = os.path.join(OUTPUT_DIR, f"{base_name}_({rvc_model}).{output_format}")
169170

170171
# Загружаем аудиофайл

rvc/infer/infer_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import argparse
88

9-
from rvc.infer.infer import rvc_infer, rvc_edgetts_infer
9+
from rvc.infer.infer import rvc_edgetts_infer, rvc_infer
1010

1111

1212
def create_parser():

tabs/components/modules.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
from rvc.infer.infer import RVC_MODELS_DIR
77

8-
98
OUTPUT_FORMAT = ["wav", "flac", "mp3", "ogg", "opus", "m4a", "aiff", "ac3"]
109

1110
edge_voices = {

tabs/inference.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1-
import os
2-
import re
3-
41
import gradio as gr
52

6-
from rvc.infer.infer import rvc_infer, rvc_edgetts_infer
7-
from tabs.components.modules import OUTPUT_FORMAT, update_edge_voices, edge_voices, update_models_list, process_file_upload, show_hop_slider, swap_visibility, swap_buttons, get_folders
3+
from rvc.infer.infer import rvc_edgetts_infer, rvc_infer
4+
from tabs.components.modules import (
5+
OUTPUT_FORMAT,
6+
edge_voices,
7+
get_folders,
8+
process_file_upload,
9+
show_hop_slider,
10+
swap_buttons,
11+
swap_visibility,
12+
update_edge_voices,
13+
update_models_list,
14+
)
815
from tabs.components.settings import settings
916

1017

0 commit comments

Comments
 (0)