Skip to content

Commit 5275264

Browse files
committed
fix: resolve 24 bugs across codebase
CRITICAL fixes (4): - easy_gui.py: Remove misplaced module-level code inside function body (IndentationError) - gui.py: Move argparse/sys.exit inside __name__ == '__main__' guard - cli.py: Remove misplaced module-level code inside try block (IndentationError) - cli_complete.py: Remove call to undefined main(), fix --help_create_reference prefix HIGH fixes (11): - model_utils.py: Fix fusion crash (.shape on dict), fix ONNX model_info crash (None.get) - csrt.py: Fix milliseconds always computed as 0 - realtime_client.py: Guard FastAPI() instantiation when package not installed - pipeline.py: Fix None slice in audio_pad (inserts axis instead of full array) - audio_processing.py: Fix STFT cache destroyed on every other call - create_reference.py: Fix shutil.rmtree deleting wrong directory - realtime/pipeline.py: Fix TypeError when return_length is None - realtime/audio.py: Fix output ASIO settings checking input device instead of output - inference.py: Fix NameError in finally (unbound segments), fix unbound end_time MEDIUM fixes (8): - config.py: Fix is_fp16() corrupting config.json with absolute paths - configs/__init__.py: Remove undefined config_settings from __all__ - config.json: Fix typo fushion_tab -> fusion_tab - pyproject.toml: Fix Python version range mismatch with _version.py - feedback.py: Add .onnx to model deletion filter - gdown.py: Fix AttributeError on unexpected Content-Disposition, fix file handle leak - huggingface.py: Fix PEP 8 None comparison - create_index.py: Fix n_ivf=0 producing invalid FAISS index
1 parent 0e64f11 commit 5275264

23 files changed

Lines changed: 134 additions & 134 deletions

advanced_rvc_inference/__init__.py

100644100755
File mode changed.

advanced_rvc_inference/api/cli.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -682,11 +682,6 @@ def cmd_serve(args):
682682
try:
683683
from advanced_rvc_inference.app.gui import launch
684684

685-
# Fix import errors by ensuring cwd is in sys.path
686-
import os
687-
if os.getcwd() not in sys.path:
688-
sys.path.append(os.getcwd())
689-
690685
launch(
691686
share=args.share,
692687
server_name=args.host,

advanced_rvc_inference/api/cli_complete.py

100644100755
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"--help_audio_effects", "--help_convert", "--help_create_dataset",
2727
"--help_create_index", "--help_extract", "--help_preprocess",
2828
"--help_separate_music", "--help_train", "--help",
29-
"--create_reference", "help_create_reference",
29+
"--create_reference", "--help_create_reference",
3030
]
3131

3232
if argv not in argv_is_allows:
@@ -331,5 +331,3 @@
331331
mp.set_start_method("spawn")
332332
if "--preprocess" in argv or "--extract" in argv:
333333
mp.set_start_method("spawn", force=True)
334-
335-
main()

advanced_rvc_inference/app/easy_gui.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -655,10 +655,6 @@ def easy_download(url, name):
655655
def get_gpu_info():
656656
import torch
657657

658-
# Fix import errors by ensuring cwd is in sys.path
659-
import os
660-
if os.getcwd() not in sys.path:
661-
sys.path.append(os.getcwd())
662658
if torch.cuda.is_available():
663659
name = torch.cuda.get_device_name(0)
664660
mem = torch.cuda.get_device_properties(0).total_memory / (1024**3)

advanced_rvc_inference/app/gui.py

100644100755
Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ def get_package_assets_path():
254254
return 1
255255
except OSError as e:
256256
if "Address already in use" in str(e):
257-
logger.error(f"Port {server_port} is already in use")
257+
logger.error(f"Port {port} is already in use")
258258
logger.info("Try using a different port with: rvc-cli serve --port 7861")
259259
else:
260260
logger.error(f"Failed to start server: {e}")
@@ -335,19 +335,14 @@ def create_app():
335335
if __name__ == "__main__":
336336
import argparse
337337

338-
# Fix import errors by ensuring cwd is in sys.path
339-
import os
340-
if os.getcwd() not in sys.path:
341-
sys.path.append(os.getcwd())
342-
343338
parser = argparse.ArgumentParser(description="Launch Advanced RVC Inference GUI")
344339
parser.add_argument("--host", default="0.0.0.0", help="Host to bind to")
345340
parser.add_argument("--port", type=int, default=7860, help="Port to bind to")
346341
parser.add_argument("--share", action="store_true", help="Create public URL (may fail in some environments)")
347342
parser.add_argument("--no-share", action="store_true", help="Disable public URL, use local access only")
348343
parser.add_argument("--open", action="store_true", help="Open in browser")
349344
parser.add_argument("--keep-alive", action="store_true", default=True, help="Keep tunnel alive (default: True)")
350-
parser.add_argument("--easy", "-ez", type=str, default=None, help="Launch Easy GUI (simplified mode). Use 'true' to enable.")
345+
parser.add_argument("--easy", "-E", type=str, default=None, help="Launch Easy GUI (simplified mode). Use 'true' to enable.")
351346

352347
args = parser.parse_args()
353348
easy_mode = args.easy is not None and args.easy.lower() in ("true", "1", "yes")

advanced_rvc_inference/app/tabs/extra/extra.py

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def extra_tab(app):
1818
gr.Markdown(translations["settings_markdown"])
1919
settings_tab(app)
2020

21-
with gr.TabItem(translations["fushion"], visible=configs.get("fushion_tab", True)):
21+
with gr.TabItem(translations["fushion"], visible=configs.get("fusion_tab", True)):
2222
gr.Markdown(translations["fushion_markdown"])
2323
fushion_tab()
2424

advanced_rvc_inference/configs/__init__.py

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
This package contains configuration files and settings.
55
"""
66

7-
__all__ = ["config", "config_settings"]
7+
__all__ = ["config"]
88

99
from .config import Config
1010
from . import config as config_module

advanced_rvc_inference/configs/config.json

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@
561561
"tts_tab": true,
562562
"create_dataset_tab": true,
563563
"training_tab": true,
564-
"fushion_tab": true,
564+
"fusion_tab": true,
565565
"read_tab": true,
566566
"onnx_tab": true,
567567
"downloads_tab": true,

advanced_rvc_inference/configs/config.py

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def is_fp16(self):
159159
fp16 = False
160160
try:
161161
with open(self.configs_path, "w", encoding="utf-8") as f:
162-
json.dump(self.configs, f, indent=4)
162+
json.dump({"fp16": False}, f)
163163
except OSError:
164164
pass
165165

advanced_rvc_inference/engine/inference/audio_processing.py

100644100755
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,9 @@ def spectral_subtract_denoise(audio, sr, noise_seconds=0.4, alpha=1.0, n_fft=102
164164

165165
if stft is None and device.startswith(("ocl", "privateuseone")):
166166
from advanced_rvc_inference.engine.models.backends.utils import STFT
167-
stft = STFT(filter_length=n_fft, hop_length=hop_length, win_length=None, window="hann").to(device)
168-
else: stft = None
167+
stft = STFT(filter_length=n_fft, hop_length=hop_length, win_length=None, window="hann").to(device)
168+
elif not device.startswith(("ocl", "privateuseone")):
169+
stft = None
169170

170171
x = torch.from_numpy(audio.astype(np.float32)).float().unsqueeze(0).to(device)
171172
window = torch.hann_window(n_fft).to(device)

0 commit comments

Comments
 (0)