""" Test script for the diarization, transcription, and translation app with insanely-fast-whisper """ import os import torch from app import DiarizationTranscriptionTranslation def test_app(): print("Testing the DiarizationTranscriptionTranslation app with insanely-fast-whisper...") # Initialize the processor processor = DiarizationTranscriptionTranslation() print("Models loaded successfully!") print(f"Using device: {processor.device}") # Check if Flash Attention is available from transformers.utils import is_flash_attn_2_available if is_flash_attn_2_available(): print("Flash Attention 2 is available - transcription will be optimized!") else: print("Flash Attention 2 is not available - using standard attention") # Check if we have the diarization pipeline if processor.diarization_pipeline is None: print("Warning: Diarization pipeline not available. Using fallback method.") print("To use the full diarization functionality, run: huggingface-cli login") else: print("Diarization pipeline loaded successfully!") print("\nApp is ready to process audio files with improved speed!") if __name__ == "__main__": test_app()