SYSTRAN / faster-whisper

Faster Whisper transcription with CTranslate2
MIT License
11.25k stars 937 forks source link

Fail to transcribe in Chinese #808

Open mru4913 opened 4 months ago

mru4913 commented 4 months ago

I have tried the following code according to README.md.

from faster_whisper import WhisperModel
import time

model_size = "./faster-distil-whisper-large-v2"

model = WhisperModel(model_size, device="cuda", compute_type="float16")

t1 = time.perf_counter()
segments, info = model.transcribe(
    "............./../0.mp3",
    # beam_size=5,
    language="zh",
    condition_on_previous_text=False,
)
print(time.perf_counter() - t1)
print(
    "Detected language '%s' with probability %f"
    % (info.language, info.language_probability)
)
for i in segments:
    print(i.text)

output is :

0.06374595290981233
Detected language 'zh' with probability 1.000000
 to me, so I want to say that I want to say,
 if you're if you're to my their research to try to...

Audio is in Chinese (madarain), I couldn't figure out why it outputs in English. Any help will be appreciated.

Purfview commented 4 months ago

Distil models are English only, you need to use a multilanguage model.