Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It appears that compatibility issues persist between whisper_timestamped v1.15.5 and openai-whisper v20240930 (TypeError: 'NoneType' object is not subscriptable) #221

Closed
JHjang223 opened this issue Nov 3, 2024 · 0 comments

Comments

@JHjang223
Copy link

JHjang223 commented Nov 3, 2024

I'm trying to use whisper-timestamped v1.15.5 along with the latest version of openai-whisper v20240930. However, after installing both versions, I encountered the following error when running the code( Additionally, i am using Python 3.9.20 and pytorch 2.1.2+cu121:

Traceback (most recent call last):
  File "/data1/whisper_test/inference.py", line 11, in test_whisper_inf
    segments = whisper.transcribe(model, file_path, language="ko", beam_size=5, best_of=5, temperature=(0.0, 0.2, 0.4, 0.6, 0.8, 1.0), vad=True, detect_disfluencies=True)
  File "/data1/whisper_test/whisper_timestamped/transcribe.py", line 304, in transcribe_timestamped
    (transcription, words) = _transcribe_timestamped_naive(model, audio,
  File "/data1/whisper_test/whisper_timestamped/transcribe.py", line 1246, in _transcribe_timestamped_naive
    attention_weights = [w[:, :, i_start-1:, :] for w in attention_weights]
  File "/data1/whisper_test/whisper_timestamped/transcribe.py", line 1246, in <listcomp>
    attention_weights = [w[:, :, i_start-1:, :] for w in attention_weights]
TypeError: 'NoneType' object is not subscriptable

Based on my investigation, it appears that this error is caused by the selective addition of a function in openai-whisper v20240930 that does not return attention weights (qk). Specifically, the scaled_dot_product_attention in torch.nn.functional was applied in the v20240930 update, and since this function does not return attention weights (qk), it seems to be causing compatibility issues with whisper-timestamped.

Although I confirmed #212, I've noticed that the disabled_sdpa() function in the latest whisper-timestamped v1.15.5 does not seem to resolve this issue effectively. Anyway, The code works perfectly with openai-whisper v20240927, where qk values are still always returned.

@JHjang223 JHjang223 changed the title It appears that compatibility issues persist between whisper_timestamped v1.15.5 and openai-whisper v20240930. (TypeError: 'NoneType' object is not subscriptable) It appears that compatibility issues persist between whisper_timestamped v1.15.5 and openai-whisper v20240930 (TypeError: 'NoneType' object is not subscriptable) Nov 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant