Comments (8)
I just pushed an experimental branch implementing word-level timestamps! It would be great if you can test this early.
Note that I implemented exactly the same logic as openai/whisper. So if there is a strange result and openai/whisper has the same result, you should report the issue to openai/whisper and not here.
Here's how you can test this today:
Install the development branch of faster-whisper
pip install --force-reinstall "faster-whisper[conversion] @ https://github.com/guillaumekln/faster-whisper/archive/refs/heads/word-level-timestamps.tar.gz"
Install the development build of CTranslate2
- Go to this build page
- Download the artifact "python-wheels"
- Extract the archive
- Install the wheel matching your system and Python version, for example:
pip install --force-reinstall ctranslate2-3.8.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Reconvert the model
The model should be converted again with the latest version of CTranslate2 as the configuration needs to be updated with additional information:
ct2-transformers-converter --model openai/whisper-large-v2 --output_dir whisper-large-v2-ct2 --copy_files tokenizer.json --quantization float16
Transcribe with word-level timestamps
segments, _ = model.transcribe(audio_path, word_timestamps=True)
for segment in segments:
print(segment.words)
from faster-whisper.
Hi,
Word-level timestamps are currently not possible. They usually require extensions to the model that are not implemented at this time.
from faster-whisper.
Thank you for the amazing work on this!
It would be amazing if world level timestamps could be implemented in faster-whisper, once the world-level-timestamps branch is merged to main in whisper
from faster-whisper.
Just checked out the whisper repo and world-level timestamp PR has been merged. I would be great indeed to have the same on faster-whiper.
Great work!
from faster-whisper.
just tested this with the tiny model and it worked!
going to do more tests but this is great, thanks so much for sharing!
from faster-whisper.
large-v2 seems to work too. Thanks again
from faster-whisper.
When I tested word timestamps on a bunch of file, I saw this error happening on some corner case:
File "/usr/local/lib/python3.10/site-packages/faster_whisper/transcribe.py", line 531, in add_word_timestamps
alignment = self.find_alignment(tokenizer, text_tokens, mel, num_frames)
File "/usr/local/lib/python3.10/site-packages/faster_whisper/transcribe.py", line 598, in find_alignment
start_times = jump_times[word_boundaries[:-1]]
IndexError: index 1 is out of bounds for axis 0 with size 1
from faster-whisper.
Thank you for testing!
Do you confirm the same file works without issue in openai/whisper? If yes, is it possible for you to share this input file?
from faster-whisper.
Related Issues (20)
- Allow loading model from memory HOT 6
- Long video processing failure without error HOT 2
- transcribe can't find files outside current script working directory HOT 4
- no kernel image is available for execution on the device HOT 4
- Fail to transcribe in Chinese HOT 1
- Question about CUDA failed with error out of memory error HOT 2
- Duplicate words HOT 1
- The timeline is advanced by 0.5s~1s HOT 1
- to_cpu isn't switching HOT 1
- initial_prompt used to the long speech HOT 1
- Issues with Capitalization and Punctuation in Transcribed Audios
- ImportError: cannot import name 'WhisperModel' from partially initialized module 'faster_whisper' (most likely due to a circular import) HOT 1
- Transcribe crash jupyter notebook kernels HOT 1
- Transcription contains unicode
- How to use the local cached model? HOT 5
- support for running through docker HOT 2
- Model not producing accurate transcriptions in Python HOT 12
- Gibberish Outputs HOT 3
- "Thanks for watching" shows up repeatedly HOT 6
- Faster-whisper issue with the latest NVIDIA 55x series drivers HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from faster-whisper.