Skip to content

Commit 806d311

Browse files
fix lint errors in python and jupyter files
1 parent 45cc611 commit 806d311

File tree

8 files changed

+19
-14
lines changed

8 files changed

+19
-14
lines changed

notebooks/ultimate_rvc_colab.ipynb

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,12 @@
3030
"import codecs\n",
3131
"import os\n",
3232
"import time\n",
33-
"import urllib.request\n",
3433
"from pathlib import Path\n",
34+
"from urllib import request\n",
3535
"\n",
3636
"import ipywidgets as widgets\n",
37-
"from IPython.display import clear_output, display\n",
37+
"from IPython.display import clear_output\n",
38+
"from IPython.display import display as i_display\n",
3839
"from pyngrok import ngrok\n",
3940
"\n",
4041
"clear_output()"
@@ -109,7 +110,7 @@
109110
" tunnel = ngrok.connect(6969)\n",
110111
" print(f\"Ngrok URL: {tunnel.public_url}\")\n",
111112
" !uv run $prerelease $runpice --listen-port 6969\n",
112-
" except Exception as e:\n",
113+
" except Exception as e: # noqa: BLE001\n",
113114
" print(f\"Error starting ngrok: {e}\")\n",
114115
"elif method == \"cloudflared\":\n",
115116
" !curl -LO https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb\n",
@@ -127,19 +128,22 @@
127128
" Path(\"url.txt\").open(\"w\", encoding=\"utf-8\").close()\n",
128129
" !lt --port 6969 >> url.txt 2>&1 &\n",
129130
" time.sleep(2)\n",
130-
" endpoint_ip = urllib.request.urlopen(\"https://ipv4.icanhazip.com\").read().decode(\"utf8\").strip(\"\\n\")\n",
131+
" endpoint_ip = (\n",
132+
" request.urlopen(\"https://ipv4.icanhazip.com\")\n",
133+
" .read()\n",
134+
" .decode(\"utf8\")\n",
135+
" .strip(\"\\n\")\n",
136+
" )\n",
131137
" tunnel_url = (\n",
132-
" Path(\"url.txt\")\n",
133-
" .read_text(encoding=\"utf-8\")\n",
134-
" .replace(\"your url is: \", \"\")\n",
138+
" Path(\"url.txt\").read_text(encoding=\"utf-8\").replace(\"your url is: \", \"\")\n",
135139
" )\n",
136140
" print(f\"Share Link: {tunnel_url}\")\n",
137141
" password_endpoint_widget = widgets.Text(\n",
138142
" value=endpoint_ip,\n",
139143
" description=\"Password IP:\",\n",
140144
" disabled=True,\n",
141145
" )\n",
142-
" display(password_endpoint_widget)\n",
146+
" i_display(password_endpoint_widget)\n",
143147
" !uv run $prerelease $runpice --listen-port 6969"
144148
]
145149
}

src/ultimate_rvc/core/generate/song_cover.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ def retrieve_song(source: str, cookiefile: StrPath | None = None) -> tuple[Path,
543543

544544
if not song_path:
545545
if source_type == SongSourceType.URL:
546-
song_url = source.split("&")[0]
546+
song_url = source.split("&", maxsplit=1)[0]
547547
song_path = _get_youtube_audio(song_url, song_dir_path, cookiefile)
548548

549549
else:

src/ultimate_rvc/core/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def download_sample_models() -> None:
4646
rprint(f"Downloading {model_name}...")
4747
try:
4848
download_voice_model(model_url, model_name)
49-
except Exception as e:
49+
except Exception as e: # noqa: BLE001
5050
rprint(f"Failed to download {model_name}: {e}")
5151

5252

src/ultimate_rvc/core/manage/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ def download_voice_model(url: str, name: str) -> None:
348348
validate_url(url)
349349
extraction_path = validate_model(name, Entity.VOICE_MODEL, mode="not_exists")
350350

351-
zip_name = url.split("/")[-1].split("?")[0]
351+
zip_name = url.rsplit("/", maxsplit=1)[-1].split("?", maxsplit=1)[0]
352352

353353
# NOTE in case huggingface link is a direct link rather
354354
# than a resolve link then convert it to a resolve link

src/ultimate_rvc/core/train/train.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,5 +356,5 @@ def stop_training(model_name: str) -> None:
356356
training_info.process_pids = []
357357
updated_training_info_dict = training_info.model_dump()
358358
json_dump(updated_training_info_dict, training_info_path)
359-
except Exception as e:
359+
except Exception as e: # noqa: BLE001
360360
logger.error("Error stopping training: %s", e) # noqa: TRY400
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Package which defines tabs for generating audio."""

src/ultimate_rvc/web/tabs/generate/speech/multi_step_generation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ def _render_step_3(total_config: TotalConfig) -> None:
305305
value=partial(
306306
update_output_name,
307307
get_mixed_speech_track_name,
308-
False, # noqa: FBT003,,
308+
False, # noqa: FBT003
309309
),
310310
inputs=[
311311
gr.State(None),

src/ultimate_rvc/web/tabs/generate/speech/one_click_generation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ def _render_output_options(tab_config: OneClickSpeechGenerationConfig) -> None:
253253
value=partial(
254254
update_output_name,
255255
get_mixed_speech_track_name,
256-
True, # noqa: FBT003,,
256+
True, # noqa: FBT003
257257
),
258258
inputs=[tab_config.source.instance, tab_config.voice_model.instance],
259259
)

0 commit comments

Comments
 (0)