Views
No views yet
1from faster_whisper import WhisperModel
2from huggingface_hub import snapshot_download
3
4downloaded_model_path = snapshot_download(repo_id="mmalyska/distil-whisper-large-v3-pl-ct2")
5
6# Run on GPU with FP16
7model = WhisperModel(downloaded_model_path, device="cuda", compute_type="float16")
8# or run on GPU with INT8
9# model = WhisperModel(downloaded_model_path, device="cuda", compute_type="int8_float16")
10# or run on CPU with INT8
11# model = WhisperModel(downloaded_model_path, device="cpu", compute_type="int8")
12
13segments, info = model.transcribe("./sample.wav", beam_size=1)
14
15print("Detected language '%s' with probability %f" % (info.language, info.language_probability))
16
17for segment in segments:
18 print("[%.2fs -> %.2fs] %s" % (segment.start, segment.end, segment.text))ct2-transformers-converter --model Aspik101/distil-whisper-large-v3-pl --output_dir distil-whisper-large-v3-pl-ct2 --copy_files tokenizer.json preprocessor_config.json --quantization float16