#!/usr/bin/env python3 """ Build script for creating standalone transcriber executable using PyInstaller. """ import subprocess import sys import os def build(): """Build the transcriber executable.""" # PyInstaller command cmd = [ sys.executable, "-m", "PyInstaller", "--onefile", "--name", "transcriber", "--distpath", "dist", "--workpath", "build", "--specpath", "build", "--hidden-import", "faster_whisper", "--hidden-import", "opencc", "--hidden-import", "numpy", "--hidden-import", "ctranslate2", "--hidden-import", "huggingface_hub", "--hidden-import", "tokenizers", "--collect-data", "faster_whisper", "--collect-data", "opencc", "transcriber.py" ] print("Building transcriber executable...") print(f"Command: {' '.join(cmd)}") result = subprocess.run(cmd, cwd=os.path.dirname(os.path.abspath(__file__))) if result.returncode == 0: print("\nBuild successful! Executable created at: dist/transcriber") else: print("\nBuild failed!") sys.exit(1) if __name__ == "__main__": build()