whisperX: [v3] TypeError: cannot pickle 'generator' object
I am getting this error when trying v3 while doing this:
import whisperx
# transcribe with original whisper
model = whisperx.load_model("tiny", device, compute_type="float32")
audio = whisperx.load_audio("LRMonoPhase4.wav")
result = model.transcribe(audio, batch_size=8)
print(result["segments"]) # before alignment
saw in the docs of faster_whisper that they do this: ‘Warning: segments is a generator so the transcription only starts when you iterate over it. The transcription can be run to completion by gathering the segments in a list or a for loop:’
segments, _ = model.transcribe("audio.mp3")
segments = list(segments) # The transcription will actually run here.
But this is not working for me either. Any ideas?
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 18 (13 by maintainers)
created pull request for this, tested the model on Replicate, seems to work perfectly! Got 10x-15x faster inference time on a 30minute mp3
Just got the same error on Python 3.10, created a new 3.8 env with given install instructions and got the error again.
thanks, ermm I havent tested python3.10, but ill have a look tonight. If urgent I would try using python3.8 or 3.9 environment, hopefully that will work
Oh forgot to give the error sorry This is what i am getting:
TypeError: cannot pickle 'generator' objectfull error log is this: