Skip to content

Can refinement be used with any ASR? #406

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

You must be logged in to vote

If the Whisper API does not return any tokens, you can manually add them to the result.

from stable_whisper.whisper_compatibility import get_tokenizer

result = stable_whisper.transcribe_any(inference, './demo.wav', vad=True)
model = stable_whisper.load_model('base')
tokenizer = get_tokenizer(model=model)
for word in result.all_words():
    word.tokens = tokenizer.encode(word.word)
model.refine('./demo.wav', result)

Note: the result must have word timestamps to begin with.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@entrider
Comment options

@jianfch
Comment options

Answer selected by entrider
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