ad-aures / mufidiwiwhi

Multi-File Diarization with Whisper
MIT License
10 stars 1 forks source link

Missing options dict when calling writers prevents output from being written to file #4

Open thomask-gh opened 1 year ago

thomask-gh commented 1 year ago

Whenever I call mufidiwiwhi, the whole transcriptions happens and gets printed to the terminal, but at the very end, when it must be written to the files, it crashes with the following error:

Traceback (most recent call last):
  File "/home/thomas/miniconda3/bin/mufidiwiwhi", line 8, in <module>
    sys.exit(cli())
  File "/home/thomas/miniconda3/lib/python3.9/site-packages/mufidiwiwhi/transcribe.py", line 434, in cli
    writer(result, output_filename)
  File "/home/thomas/miniconda3/lib/python3.9/site-packages/mufidiwiwhi/utils.py", line 69, in write_all
    writer(result, file)
TypeError: __call__() missing 1 required positional argument: 'options'

Indeed, the writers provided by whisper require an options dict that also cannot just be empty (I tried passing an empty dict) because some of the concrete writers expect some specific options to be present in it.

This requirement has been added in this commit and the options dict is generated in transcribe.py from the parsed command line arguments.


In the meantime, I have saved in a separate the output of the transcription that was printed to the terminal and I’d like to find a way to convert it to srt without having to re-run the transcription, which took several hours. What suggestions would you have for this? Thanks!

benjaminbellamy commented 1 year ago

Have you tried adding

options = whisper.DecodingOptions()

?

Regarding the transcription you ran, I have no suggestion yet.

MonsieurPoutounours commented 11 months ago

Hi,

Same problem here and everything is lost after hours of work :-(

Did you found a way ?

Shaac commented 10 months ago

I made it work adding the default dict {"highlight_words": False, "max_line_count": None, "max_line_width": None} as a third argument to writer here https://github.com/ad-aures/mufidiwiwhi/blob/main/mufidiwiwhi/transcribe.py#L434

I also had to change in utils.py: add options: dict to the signature of write_result and write_all. And in write_all, add options as the last argument of writer


I also tried to to set "max_line_count": 2, "max_line_width": 32 to have a format with correct podcasting 2.0 specifications https://github.com/Podcastindex-org/podcast-namespace/blob/main/transcripts/transcripts.md#properties but it did not change anything

benjaminbellamy commented 10 months ago

I should probably clean that code. Will try to do that this week…

thomask-gh commented 9 months ago

Hi, any update on this @benjaminbellamy? :blush:

benjaminbellamy commented 8 months ago

This project is not dead, yet. 😉 I'm working on it now with the v3 models that were published last month by openai. Stay tuned. 📻️

thomask-gh commented 8 months ago

Great to know, thanks a lot for your work on it, wishing you strength for this and a happy holiday season! :wink: :sparkles:

MonsieurPoutounours commented 5 months ago

Hi @benjaminbellamy

Any news on this ? :-)

johnpoelstra commented 2 months ago

The error goes away for me with a different version of whisper, however the final output seems incomplete.

$ pip install openai-whisper==20230314