Vaibhavs10 / insanely-fast-whisper

Apache License 2.0
7.5k stars 529 forks source link

Detect language #131

Closed rusty-ai closed 9 months ago

rusty-ai commented 9 months ago

Is there any way to just detect the language of the audio, as it was in the original Whisper? Eg.

mel = whisper.log_mel_spectrogram(vocals_chunk).to(model.device)
_, probs = self.whisper_model.detect_language(mel)
language = max(probs , key=final_probs.get)
Vaibhavs10 commented 9 months ago

Hi @rusty-ai ,

Currently, within the context of the CLI, we cannot, as we use a high-level abstraction on top of the transformers API called pipeline. However, you can get the same directly from transformers: https://github.com/huggingface/transformers/issues/25138#issuecomment-1836554598