abdeladim-s / subsai

🎞️ Subtitles generation tool (Web-UI + CLI + Python package) powered by OpenAI's Whisper and its variants 🎞️
https://abdeladim-s.github.io/subsai/
GNU General Public License v3.0
1.25k stars 104 forks source link

whisper-timestamped crashes on creating plots -- but not when used standalone #12

Closed jlinkels closed 1 year ago

jlinkels commented 1 year ago

Hi,

I am trying to use the linto-ai/whisper-timestamped model from within subsai. I don't use any model configuration: subsai -m linto-ai/whisper-timestamped -f srt test0.webm whisper-timestamped insists on loading the matplotlib library. And crashes.

whisper_timestamped is not supposed to do that. When the plot option is False, whisper_timestamped should not import this library. In subsai this option is plot_word_alignment. In subsai the option plot_word_alignment is False by default. The strange thing is, when I call whisper_timestamped directly from the command line: whisper_timestamped --output_format srt --output_dir /tmp/ --vad True --task transcribe assets/audio/test0.mp3 the plot option is false and the command is executed successfully.

From a previous installation I know that when I do install matplotlib I can call the whisper-timestamped model from within subsai, but then matplotlib launches a graph for every sentence. Which is not really useful.

It seems that the whisper_timestamped CLI passes the model configuration in a different way to whisper_timestamp.transcribe() than when called directly from subsai.

Is this a known issue?

If not, I want to start working on this during the weekend and see why whisper_timestamped thinks it should plot.

abdeladim-s commented 1 year ago

Hi,

I think you didn't pull the latest commits, I have fixed this bug recently.

Please pull the latest commit and test it again, and let me know if the problem persists ?

jlinkels commented 1 year ago

Hi,

You are right. I had pulled the latest commits but made a mistake in the installation. I executed the previous script.

The whisper-timestamped model is working correctly now.

Thanks!

abdeladim-s commented 1 year ago

Prefect! You are welcome @jlinkels.