Skip to content

Commit

Permalink
add alignment_heads attribute to the model. That might be needed when…
Browse files Browse the repository at this point in the history
… decoding
  • Loading branch information
Jeronymous committed Feb 15, 2024
1 parent e5b5819 commit 90720b8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions whisper_timestamped/transcribe.py
Original file line number Diff line number Diff line change
Expand Up @@ -1038,6 +1038,7 @@ def hook_output_logits(layer, ins, outs):
all_hooks.append(model.decoder.ln.register_forward_hook(hook_output_logits))

try:
model.alignment_heads = alignment_heads # Avoid exception "AttributeError: 'WhisperUntied' object has no attribute 'alignment_heads'. Did you mean: 'set_alignment_heads'?""
transcription = model.transcribe(audio, **whisper_options)
finally:
for hook in all_hooks:
Expand Down

0 comments on commit 90720b8

Please sign in to comment.