#!/usr/bin/env python3 """ Test script to verify faster_whisper integration """ import os from faster_whisper import WhisperModel def test_whisper_setup(): """Test if faster_whisper is working correctly""" print("๐Ÿงช Testing faster_whisper setup...") try: # Try to initialize the smallest model print("๐Ÿ“ฅ Loading tiny model (this might take a moment on first run)...") model = WhisperModel("tiny") print("โœ… Successfully loaded Whisper tiny model!") # Check available models available_models = ["tiny", "base", "small", "medium", "large"] print(f"๐ŸŽฏ Available models: {', '.join(available_models)}") # Test basic functionality with a short audio print("๐Ÿ” Whisper model ready for transcription!") return True except Exception as e: print(f"โŒ Error: {e}") return False if __name__ == "__main__": if test_whisper_setup(): print("\n๐ŸŽ‰ faster_whisper is ready to use!") print("๐Ÿ’ก Your subtitle generator now has much better speech recognition!") else: print("\nโš ๏ธ There might be an issue with faster_whisper setup")