File size: 1,014 Bytes
673435a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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

import torch
import ctranslate2

print(f"Torch CUDA available: {torch.cuda.is_available()}")
if torch.cuda.is_available():
    print(f"Device count: {torch.cuda.device_count()}")
    print(f"Device name: {torch.cuda.get_device_name(0)}")

print(f"CTranslate2 CUDA available: {ctranslate2.get_cuda_device_count() > 0}")

try:
    from faster_whisper import WhisperModel
    print("Testing WhisperModel load on CPU with float16 (expect failure if CPU)...")
    try:
        model = WhisperModel("tiny", device="cpu", compute_type="float16")
        print("Success loading float16 on CPU (unexpected)")
    except Exception as e:
        print(f"Caught expected error on CPU float16: {e}")

    print("Testing WhisperModel load on CPU with int8...")
    try:
        model = WhisperModel("tiny", device="cpu", compute_type="int8")
        print("Success loading int8 on CPU")
    except Exception as e:
        print(f"Failed loading int8 on CPU: {e}")

except ImportError:
    print("faster_whisper not installed")