38 lines
1.2 KiB
Python
38 lines
1.2 KiB
Python
#!/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")
|