class_docstr: Transcribe and parse audio files with OpenAI Whisper model.
  
  Audio transcription with OpenAI Whisper model locally from transformers.
  
  Parameters:
  device - device to use
      NOTE: By default uses the gpu if available,
      if you want to use cpu, please set device = "cpu"
  lang_model - whisper model to use, for example "openai/whisper-medium"
  forced_decoder_ids - id states for decoder in multilanguage model,
      usage example:
      from transformers import WhisperProcessor
      processor = WhisperProcessor.from_pretrained("openai/whisper-medium")
      forced_decoder_ids = WhisperProcessor.get_decoder_prompt_ids(language="french",
        task="transcribe")
      forced_decoder_ids = WhisperProcessor.get_decoder_prompt_ids(language="french",
      task="translate")
docstr: Lazily parse the blob.
code: def lazy_parse(self, blob: Blob) -> Iterator[Document]:
      """Lazily parse the blob."""
  
      import io
  
      try:
          from pydub import AudioSegment
      except ImportError:
          raise ImportError(
              "pydub package not found, please install it with `pip install pydub`"
          )
  
      try:
          import librosa
      except ImportError:
          raise ImportError(
              "librosa package not found, please install it with "
              "`pip install librosa`"
          )
  
      file = str(blob.path)
      if any([file.endswith(x) for x in [".mp4", ".mpeg", ".mpg"]]):
          import audioread.ffdec  # Use ffmpeg decoder
  
          aro = audioread.ffdec.FFmpegAudioFile(blob.path)
          y, sr = librosa.load(aro, sr=16000)
      else:
          # Audio file from disk
          audio = AudioSegment.from_file(blob.path)
  
          file_obj = io.BytesIO(audio.export(format="mp3").read())
  
          # Transcribe
          print(f"Transcribing part {blob.path}!")
  
          y, sr = librosa.load(file_obj, sr=16000)
  
      prediction = self.pipe(y.copy(), batch_size=8)["text"]
  
      yield Document(
          page_content=prediction,
          metadata={"source": blob.source},
      )
  
imports: import logging
  import os
  import tempfile
  import time
  from typing import Dict, Iterator, Optional, Tuple
  from langchain.document_loaders.base import BaseBlobParser
  from langchain.document_loaders.blob_loaders import Blob
  from langchain.document_loaders.generic import GenericLoader
  from langchain.schema import Document
  from typing import List, Union, Any, Tuple
  import requests
  from langchain.docstore.document import Document
  from langchain.document_loaders import ImageCaptionLoader
  from utils import get_device, NullContext, clear_torch_cache, have_use_faster, makedirs
  from importlib.metadata import distribution, PackageNotFoundError
  from typing import Iterable, List
  from langchain.document_loaders.blob_loaders import FileSystemBlobLoader
  from langchain.document_loaders.blob_loaders.schema import Blob, BlobLoader
label_desc: Use image node_id 2 for calling the OpenAIWhisperParserLocal obj's underlying member method code with example usage: obj.lazy_parse(blob) without return types