ai Convert from mp3 to text

1. Download from https://huggingface.co/Systran/faster-whisper-large-v3/tree/main

2. Load model locally and processing mp3 in python.

 

from faster_whisper import WhisperModel

model_size = "large-v3"

model = WhisperModel(
r"J:\faster-whisper-large-v3",
device="cuda",
compute_type="float16"
)

print("Model loaded successfully!")

# Run on GPU with FP16
#model = WhisperModel(model_size, device="cuda", compute_type="float16")

# or run on GPU with INT8
# model = WhisperModel(model_size, device="cuda", compute_type="int8_float16")
# or run on CPU with INT8
# model = WhisperModel(model_size, device="cpu", compute_type="int8")

file_path=r"pathtoyour.mp3"
print("processing ",file_path)
segments, info = model.transcribe(file_path, beam_size=5)

print("Detected language '%s' with probability %f" % (info.language, info.language_probability))

for segment in segments:
print("[%.2fs -> %.2fs] %s" % (segment.start, segment.end, segment.text))