logger.info(
                    "Unable to set forced_decoder_ids parameter for whisper model"
                    f"Text of exception: {exception_text}"
                    "Therefore whisper model will use default mode for decoder"
                )
[docs]    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`"
            )
        # 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},
        )
[docs]class YandexSTTParser(BaseBlobParser):
    """Transcribe and parse audio files.
    Audio transcription is with OpenAI Whisper model."""
[docs]    def __init__(
        self,
        *,
        api_key: Optional[str] = None,
        iam_token: Optional[str] = None,
        model: str = "general",
        language: str = "auto",
    ):
        """Initialize the parser.
        Args: