File size: 1,024 Bytes
f0cf837
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
35
36
37
38
39
40
41

import sys
import os

print("Debugging WhisperX on CPU...")
print(f"Python: {sys.version}")

try:
    import torch
    print(f"PyTorch version: {torch.__version__}")
except ImportError:
    print("PyTorch not found!")

try:
    import whisperx_legen_fork as whisperx
    print("WhisperX module imported successfully.")
except ImportError as e:
    print(f"Failed to import whisperx_legen_fork: {e}")
    sys.exit(1)

device = "cpu"
compute_type = "float32" # Int8 or float32 are required for CPU

print(f"Attempting to load model 'tiny' on {device} with {compute_type}...")

try:
    model = whisperx.load_model(
        "tiny",
        device=device,
        compute_type=compute_type,
        asr_options={"repetition_penalty": 1, "prompt_reset_on_temperature": 0.5, "no_repeat_ngram_size": 2}
    )
    print("SUCCESS: Model loaded correctly!")
except Exception as e:
    print("\nERROR loading model:")
    print(e)
    import traceback
    traceback.print_exc()

print("Done.")