Skip to content

Make Whisper to Recognise Names #400

Answered by jianfch
felipehertzer asked this question in Q&A
Discussion options

You must be logged in to vote

Lets say the model transcribes "Emily" but you want it to be 'Emilie', you can prompt it with 'Emilie':

model = stable_whisper.load_hf_whisper('base')
prompt_ids = model._pipe.tokenizer.get_prompt_ids('Emilie', return_tensors="pt").to(model._pipe.model.device)
result = model.transcribe('audio.wav', prompt_ids=prompt_ids)

If the prompt shows up at the beginning of the transcription (huggingface/transformers#27836), updating transformers should fix it.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@felipehertzer
Comment options

Answer selected by felipehertzer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants