# -*- mode: python ; coding: utf-8 -*- # PyInstaller onedir 빌드: pyinstaller gvr-worker.spec → dist/gvr-worker/gvr-worker.exe # 콘솔 앱이지만 부모(Electron)가 windowsHide 로 띄우므로 창은 보이지 않는다. from PyInstaller.utils.hooks import collect_data_files, collect_dynamic_libs, collect_submodules datas = [] binaries = [] hiddenimports = [] # faster-whisper: Silero VAD onnx (assets/) datas += collect_data_files("faster_whisper") # CTranslate2 / onnxruntime / PyAV 네이티브 라이브러리 for pkg in ("ctranslate2", "onnxruntime", "av"): binaries += collect_dynamic_libs(pkg) hiddenimports += collect_submodules("av") hiddenimports += ["pyloudnorm", "scipy.signal", "scipy.ndimage", "pynvml"] # 파인튜닝 스크립트는 별도 파이썬 환경에서 돌리므로 모듈로 묶지 않고 파일로만 넣는다 datas += [("gvr_worker/finetune/*.py", "gvr_worker/finetune"), ("gvr_worker/finetune/requirements.txt", "gvr_worker/finetune")] a = Analysis( ["run_worker.py"], pathex=["."], binaries=binaries, datas=datas, hiddenimports=hiddenimports, excludes=["gvr_worker.finetune", "torch", "transformers", "peft", "tkinter", "matplotlib", "IPython", "pytest"], noarchive=False, ) pyz = PYZ(a.pure) exe = EXE( pyz, a.scripts, [], exclude_binaries=True, name="gvr-worker", console=True, upx=False, ) coll = COLLECT(exe, a.binaries, a.datas, strip=False, upx=False, name="gvr-worker")