File size: 1,252 Bytes
4d4eaf0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
"""
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()