fix: exe 에서 자막이 하나도 안 나오던 것 (Silero VAD 모델 누락)
Some checks failed
Windows / verify (push) Has been cancelled

포터블 exe 에 faster_whisper/assets/silero_vad_v6.onnx 가 빠져 있었다.
확정 문장 인식은 vad_filter=True 라서 매번 NoSuchFile 로 실패했고,
엔진이 경고 로그만 남기고 넘어가 어떤 목소리도 자막이 되지 않았다.
소스 점검(--pipeline)은 파일이 있는 venv 에서 돌아 통과했다.

- livesub.spec: collect_data_files("faster_whisper") 로 assets 를 넣는다.
- windows_smoke --exe: exe 안에 VAD 모델·용어집이 들어 있는지 확인한다.
  test7 exe 에 돌리면 silero_vad_v6.onnx 가 빠졌다고 실패한다.

함께, 효과가 걸린 게임 목소리를 Silero 가 통째로 버리던 것도 고친다.
사용자 녹음의 "Get up! Over here!" 는 Silero 확률이 0.14 라 사라졌다.
Silero 가 구간 전체를 버렸을 때만 VAD 없이 한 번 더 받고, 잡음 환각은
창 끝까지 이어진 구간(Thank you. 29.98s), 낮은 log 확률(< -1.0),
높은 압축률로 거른다. 실제 모델(turbo·small)로 사용자 녹음 대사 3개를
모두 받고 잡음 구간 5곳은 모두 빈 결과임을 확인했다.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
EJClaw
2026-10-09 17:29:00 +09:00
parent d9b23dd20b
commit 1f59ed0679
4 changed files with 132 additions and 16 deletions

View File

@@ -27,7 +27,7 @@
from pathlib import Path
from PyInstaller.utils.hooks import collect_dynamic_libs
from PyInstaller.utils.hooks import collect_data_files, collect_dynamic_libs
BLOCK_CIPHER = None
ROOT = Path(SPECPATH).parent # noqa: F821 - PyInstaller 가 주입
@@ -39,6 +39,11 @@ capture_exe = SRC / "livesub" / "resources" / "bin" / "livesub_capture.exe"
if capture_exe.is_file():
datas.append((str(capture_exe), "livesub/resources/bin"))
# faster-whisper 는 문장을 확정할 때 Silero VAD 모델(assets/silero_vad_v6.onnx)을
# 패키지 폴더에서 읽는다. .py 가 아닌 파일이라 PyInstaller 가 자동으로 넣지 않고,
# 빠지면 확정 문장 인식이 매번 실패해 자막이 하나도 안 나온다 (v0.3.0-test7 까지).
datas += collect_data_files("faster_whisper")
# CTranslate2 는 CUDA/cuDNN DLL 을 곁에 두고 로드한다. 자동 수집에서 빠지기 쉽다.
binaries = collect_dynamic_libs("ctranslate2")

View File

@@ -526,6 +526,21 @@ def _scratch_appdata():
shutil.rmtree(tmp, ignore_errors=True)
#: exe 안에 반드시 있어야 하는 .py 아닌 파일. 빠져도 창은 잘 뜨고 소스 점검도
#: 통과하므로, 실제로 말소리가 들어올 때가 돼서야 터진다.
EXE_REQUIRED_FILES = (
"faster_whisper/assets/silero_vad_v6.onnx", # 확정 문장 인식의 VAD
"livesub/resources/glossaries/fps-common.json",
)
def missing_bundle_files(exe: Path) -> list[str]:
from PyInstaller.archive.readers import CArchiveReader
names = {name.replace("\\", "/") for name in CArchiveReader(str(exe)).toc}
return [f for f in EXE_REQUIRED_FILES if f not in names]
def run_exe_check(exe: Path) -> None:
print(f"\n=== 빌드된 exe 점검: {exe} ===")
@@ -538,6 +553,13 @@ def run_exe_check(exe: Path) -> None:
raise RuntimeError(f"{mb:.0f}MB — 너무 큼. torch 가 섞여 들어갔는지 확인")
return f"{mb:.1f} MB"
@check("exe 에 실행 중 읽는 파일이 들어 있는지")
def _bundled_files():
missing = missing_bundle_files(exe)
if missing:
raise RuntimeError(f"빠짐: {', '.join(missing)}")
return f"{len(EXE_REQUIRED_FILES)}개 확인"
@check("exe 첫 실행 — 저장 위치 화면")
def _first_run():
# APPDATA 를 빈 폴더로 돌려 "처음 켜는 사람" 을 그대로 재현한다.