Files
AudioTranscriberCombine/main.py
jadssss 84d7a28c69 pre-scan finished tracks and load CUDA lazily
- pre-scan all inputs before chunking so ready files stay out of batches\n- start overall progress at the already-finished count\n- count skipped/resumed files correctly in sequential and staged runs\n- keep batches full and log ready/pending counts before starting\n- avoid importing Torch at startup or in cleanup for separation-only runs\n- move TF32 setup into lazy WhisperX model loading\n- detect the GPU through nvidia-smi for the GUI status line
2026-10-27 23:19:56 +03:00

48 lines
1.1 KiB
Python

#!/usr/bin/env python3
"""Song Transcriber — Qt GUI entry point."""
from __future__ import annotations
import ctypes
import os
import sys
# Must be set BEFORE PySide6 is imported.
os.environ.setdefault("QT_LOGGING_RULES", "qt.qpa.wayland.textinput=false")
def preload_cudnn() -> None:
try:
import nvidia.cudnn
except ImportError:
return
lib_dir = os.path.join(nvidia.cudnn.__path__[0], "lib")
if not os.path.isdir(lib_dir):
return
for fname in sorted(os.listdir(lib_dir)):
if ".so" in fname:
try:
ctypes.CDLL(os.path.join(lib_dir, fname), mode=ctypes.RTLD_GLOBAL)
except OSError:
pass
def main() -> int:
preload_cudnn()
from PySide6.QtWidgets import QApplication
from gui.theme import DARK_STYLESHEET
from gui.main_window import MainWindow
app = QApplication(sys.argv)
app.setApplicationName("Audio Transcriber")
app.setStyle("Fusion")
app.setStyleSheet(DARK_STYLESHEET)
window = MainWindow()
window.show()
return app.exec()
if __name__ == "__main__":
sys.exit(main())