Skip to content

Whisper word level timestemp #47

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

Open
apssouza22 opened this issue Mar 8, 2025 · 6 comments
Open

Whisper word level timestemp #47

apssouza22 opened this issue Mar 8, 2025 · 6 comments

Comments

@apssouza22
Copy link

I am wondering if it is possible to have word level timestamp when using the whisper example? I tried to include the param word_timestamps to the model options but it didn't work.

Any help in how to achieve this will be very welcome.
Thanks

@danieloi
Copy link

danieloi commented May 1, 2025

They don't appear to work with the distil models. the old xenova ones seem fine though less accurate for me than the sample for the distilled version here https://huggingface.co/spaces/Xenova/distil-whisper-web but it only gives sentence timestamps

@apssouza22
Copy link
Author

@danieloi I managed to do it here https://github.com/apssouza22/video-text-edit

@danieloi
Copy link

danieloi commented May 2, 2025

@apssouza22 it works for word-level timestamps when you use the distil variants of the model?

@apssouza22
Copy link
Author

apssouza22 commented May 2, 2025

Oh sorry, distilled didn't work, but I thought it was because the models are too big.
@danieloi

@danieloi
Copy link

danieloi commented May 2, 2025

Same here @apssouza22, I get this error when I want word-level timestamps and use the distil variants in transformers.js:

Error: Layer index 6 is out of bounds for cross attentions (length 4).
at webpack://@huggingface/transformers/./src/models.js:3498:1
at Array.map ()
at Function._extract_token_timestamps (webpack://@huggingface/transformers/./src/models.js:3496:30)
at Function.generate (webpack://@huggingface/transformers/./src/models.js:3442:1)
at async Function._call_whisper (webpack://@huggingface/transformers/./src/pipelines.js:1867:1)
... message: 'Layer index 6 is out of bounds for cross attentions (length 4).'}

@apssouza22
Copy link
Author

@danieloi yeah. Got the same.
Let me know if you manage to get it sorted

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

2 participants