# whisper-dictation.spec # -*- mode: python ; coding: utf-8 -*- import os, sys import importlib, site def _pkg_path(pkg): mod = importlib.import_module(pkg) if mod.__file__: return os.path.dirname(mod.__file__) # namespace package — resolve via site-packages sp = site.getsitepackages()[0] return os.path.join(sp, *pkg.split('.')) _sp = next(p for p in site.getsitepackages() if p.endswith('site-packages')) _nvidia = os.path.join(_sp, 'nvidia') a = Analysis( ['main.py'], pathex=[], binaries=[ (os.path.join(_nvidia, 'cublas', 'bin', '*.dll'), '.'), (os.path.join(_nvidia, 'cudnn', 'bin', '*.dll'), '.'), ], datas=[ (os.path.join(_pkg_path('faster_whisper'), 'assets', '*.onnx'), 'faster_whisper/assets'), ], hiddenimports=[ 'ctranslate2', 'faster_whisper', 'sounddevice', 'pynput.keyboard._win32', 'pynput.keyboard._xorg', 'pynput.keyboard._uinput', ], hookspath=[], hooksconfig={}, runtime_hooks=[], excludes=[], noarchive=False, ) pyz = PYZ(a.pure) exe = EXE( pyz, a.scripts, [], exclude_binaries=True, name='whisper-dictation', debug=False, bootloader_ignore_signals=False, strip=False, upx=True, console=False, icon='icon.ico', ) coll = COLLECT( exe, a.binaries, a.datas, strip=False, upx=True, upx_exclude=[], name='whisper-dictation', )