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)
- 2 wavs file with same content generate different result HOT 4
- Problem with audio HOT 5
- How to run HOT 2
- CUDA 12 required? HOT 4
- faster-whisper docker example? HOT 2
- Word-level timestamps are off by some multiplier HOT 1
- Does it support converting to ONNX format models?
- question: client sdk HOT 1
- RuntimeError: CUDA failed with error CUDA driver version is insufficient for CUDA runtime version HOT 2
- Whisper-live taking same time on CPU and GPU to transcribe an audio HOT 4
- is it possible for customize VAD model path?
- Are timestamp tokens used in previous text?
- How do I get both transcript and translated output from single process? HOT 4
- mkl_malloc: failed to allocate memory HOT 1
- Can we modify vocabulary
- change subtitles lenght per line HOT 1
- 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
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.