#!/bin/bash # Build Script for whisper-transcribe # This script bundles the project into a single executable for Apple Silicon. echo "--- Starting Build Process ---" # Ensure PyInstaller is installed if ! command -v pyinstaller &> /dev/null then echo "PyInstaller not found. Installing..." pip install pyinstaller fi # Run PyInstaller # --onefile: Bundle into a single executable # --collect-all: Ensure all sub-dependencies of heavy libraries are included # --hidden-import: Explicitly include libraries that might be missed by static analysis # Added --collect-all mlx and --hidden-import mlx._reprlib_fix to solve the runtime error pyinstaller --onefile \ --name whisper-transcribe \ --collect-all mlx \ --collect-all mlx_whisper \ --collect-all transformers \ --collect-all silero_vad \ --collect-all torch \ --hidden-import=mlx._reprlib_fix \ --hidden-import=sacremoses \ --hidden-import=joblib \ transcribe.py echo "--- Build Complete ---" echo "Binary location: dist/whisper-transcribe"