SYSTRAN / faster-whisper

Faster Whisper transcription with CTranslate2
MIT License
12.1k stars 1.02k forks source link

Suddenly no start, end or text in generator? #952

Open michaelcuneo opened 2 months ago

michaelcuneo commented 2 months ago

I have a project that is using Whisper, and I have create an API endpoint that will transcribe... all of a sudden I'm getting no start, end, or text from the segments.

  model = WhisperModel("tiny.en", device="cpu", num_workers=4, cpu_threads=4, compute_type="int8")
  segments  = model.transcribe(audioPath, word_timestamps=False, beam_size=1)

  combined_text = " ".join([segment.text.strip() for segment in segments])

Error is AttributeError: 'generator' object has no attribute 'text'

MahmoudAshraf97 commented 2 months ago

it should be:

segments, info  = model.transcribe(audioPath, word_timestamps=False, beam_size=1)