From 90720b8c3af8985328b01c736260da34888e3af3 Mon Sep 17 00:00:00 2001 From: Jeronymous Date: Thu, 15 Feb 2024 18:15:43 +0100 Subject: [PATCH] add alignment_heads attribute to the model. That might be needed when decoding --- whisper_timestamped/transcribe.py | 1 + 1 file changed, 1 insertion(+) diff --git a/whisper_timestamped/transcribe.py b/whisper_timestamped/transcribe.py index e7127ee..255c994 100644 --- a/whisper_timestamped/transcribe.py +++ b/whisper_timestamped/transcribe.py @@ -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: