-
|
Hey. Hey, Whisper's good at detecting language if I don't give it one. But is it possible to only run this detection without it then starting to convert the video to that language? |
Beta Was this translation helpful? Give feedback.
Answered by
glangford
Dec 21, 2022
Replies: 1 comment
-
|
The README shows how to run detection only. Scroll down to "Python usage" near the bottom, starting with
# load audio and pad/trim it to fit 30 seconds
audio = whisper.load_audio("audio.mp3")
audio = whisper.pad_or_trim(audio)
# make log-Mel spectrogram and move to the same device as the model
mel = whisper.log_mel_spectrogram(audio).to(model.device)
# detect the spoken language
_, probs = model.detect_language(mel)
print(f"Detected language: {max(probs, key=probs.get)}") |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
schotek
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The README shows how to run detection only. Scroll down to "Python usage" near the bottom, starting with