Ë
    ñâ–iÛ  ã                  óð   — d dl mZ d dlmZmZmZ d dlmZ d dlm	Z	m
Z
 erd dlZd dlZd dlmZ d dlmZ  G d„ d	ed
¬«      Z G d„ ded
¬«      Z G d„ de«      Z G d„ d«      Z	 	 	 d	 	 	 	 	 	 	 	 	 	 	 dd„Zy)é    )Úannotations)ÚTYPE_CHECKINGÚLiteralÚ	TypedDict)Ú	AudioData)ÚTranscribeOutputBaseÚWhisperCompatibleRecognizerN)ÚUnpack)ÚWhisperc                  ó,   — e Zd ZU ded<   ded<   ded<   y)ÚLoadModelOptionalParameterszstr | torch.deviceÚdeviceÚstrÚdownload_rootÚboolÚ	in_memoryN©Ú__name__Ú
__module__Ú__qualname__Ú__annotations__© ó    úr/var/www/auto_recruiter/arenv/lib/python3.12/site-packages/speech_recognition/recognizers/whisper_local/whisper.pyr   r      s   … àÓØÓØ„Or   r   F)Útotalc                  ó:   — e Zd ZU dZded<   ded<   ded<   ded	<   y
)ÚTranscribeOptionalParametersz<Transcribe optional parameters & DecodingOptions parameters.zfloat | tuple[float, ...]Útemperaturez"Literal['transcribe', 'translate']Útaskr   Úlanguager   Úfp16N)r   r   r   Ú__doc__r   r   r   r   r   r      s   … ÙFð +Ó*ð -Ó,ØƒMØ
„Jr   r   c                  ór   — e Zd ZU ded<   ded<   ded<   ded<   ded<   d	ed
<   ded<   ded<   ded<   ded<   y)ÚSegmentÚintÚidÚseekÚfloatÚstartÚendr   Útextz	list[int]Útokensr   Úavg_logprobÚcompression_ratioÚno_speech_probNr   r   r   r   r$   r$   &   s9   … ØƒGØ
ƒIØƒLØ	ƒJØ
ƒIØÓØÓØÓØÓØÔr   r$   c                  ó$   — e Zd Zdd„Z	 	 	 	 dd„Zy)ÚTranscribableAdapterc                ó   — || _         y )N)Úmodel)Úselfr3   s     r   Ú__init__zTranscribableAdapter.__init__4   s	   € Øˆ
r   c                ó†   — d|vr!dd l }|j                  j                  «       |d<    | j                  j                  |fi |¤ŽS )Nr!   r   )ÚtorchÚcudaÚis_availabler3   Ú
transcribe)r4   Úaudio_arrayÚkwargsr7   s       r   r:   zTranscribableAdapter.transcribe7   sA   € ð ˜ÑÛà"ŸZ™Z×4Ñ4Ó6ˆF6‰Nà$ˆtz‰z×$Ñ$ [Ñ;°FÑ;Ð;r   N)r3   r   ÚreturnÚNone)r;   z
np.ndarrayr=   zTranscribeOutputBase[Segment])r   r   r   r5   r:   r   r   r   r1   r1   3   s   „ óð<Ø%ð<à	&ô<r   r1   c                óŠ   — ddl } |j                  |fi |xs i ¤Ž}t        t        |«      «      } |j                  |fd|i|¤ŽS )aí  Performs speech recognition on ``audio_data`` (an ``AudioData`` instance), using Whisper.

    Pick ``model`` from output of :command:`python -c 'import whisper; print(whisper.available_models())'`.
    See also https://github.com/openai/whisper?tab=readme-ov-file#available-models-and-languages.

    If ``show_dict`` is true, returns the full dict response from Whisper, including the detected language. Otherwise returns only the transcription.

    You can specify:

        * ``language``: recognition language, an uncapitalized full language name like "english" or "chinese". See the full language list at https://github.com/openai/whisper/blob/main/whisper/tokenizer.py

            * If not set, Whisper will automatically detect the language.

        * ``task``

            * If you want transcribe + **translate** to english, set ``task="translate"``.

    Other values are passed directly to whisper. See https://github.com/openai/whisper/blob/main/whisper/transcribe.py for all options.
    r   NÚ	show_dict)ÚwhisperÚ
load_modelr	   r1   Ú	recognize)	Ú
recognizerÚ
audio_datar3   r@   Úload_optionsÚtranscribe_optionsrA   Úwhisper_modelÚwhisper_recognizers	            r   rC   rC   B   sa   € ó8 à&G×&Ñ& uÑC°Ò0BÀÑC€MÜ4Ü˜]Ó+óÐð (Ð×'Ñ'ØñØ'ðØ+=ñð r   )ÚbaseFN)rE   r   r3   r   r@   r   rF   z"LoadModelOptionalParameters | NonerG   z$Unpack[TranscribeOptionalParameters]r=   z#str | TranscribeOutputBase[Segment])Ú
__future__r   Útypingr   r   r   Úspeech_recognition.audior   Ú1speech_recognition.recognizers.whisper_local.baser   r	   ÚnumpyÚnpr7   Útyping_extensionsr
   rA   r   r   r   r$   r1   rC   r   r   r   ú<module>rR      s£   ðÝ "ç 4Ñ 4å .÷ñ ÛÛÝ(Ýô )°5õ ô
 9°Eõ 
ô
ˆiô 
÷<ñ <ð$ ØØ7;ð$àð$ð ð$ð ð	$ð
 5ð$ð ?ð$ð )ô$r   