+
    &j!                         ^ RI t ^ RIt^ RIt^ RIt^ RIt^RIHt ^RIHtH	t	 ^RI
H
t
 ^RIHt R tR t]R8X  d
   ]! 4        R# R# )	    N)audio)	LANGUAGESTO_LANGUAGE_CODE)
transcribe)
get_writerc                  R   R  p R pR p\         P                  ! \         P                  R7      pVP                  RRRR7       VP                  RR	\        R
R7       VP                  R\        RRR7       VP                  RR\        RRR7       VP                  RR\        R. RRORR7       VP                  RVRRR7       VP                  R\        RRR.RR7       TP                  R \        R\        \        P                  ! 4       4      \        \        P                  ! 4        Uu. uF  qDP                  4       NK  	  up4      ,           R!R7       VP                  R"\        ^ R#R7       VP                  R$V ^R%R7       VP                  R&\        RR'R7       VP                  R(\        RR)R7       VP                  R*\        R+R,R7       VP                  R-\        RR.R7       VP                  R/VRR0R7       VP                  R1VRR2R7       VP                  R3VR4R5R7       VP                  R6VRSR7R7       VP                  R8VR9R:R7       VP                  R;VR<R=R7       VP                  R>\        R?R@R7       VP                  RA\        RBRCR7       VP                  RDVR<RER7       VP                  RF\        RRGR7       VP                  RH\        RRIR7       VP                  RJ\        RRKR7       VP                  RLVRMRN7       VP                  RO\        RPRQR7       V# u upi )Tc                 *    V R 8X  d   R# \        V 4      # NoneN)intstrings   &g/Users/jameslopez/projects/CWCArchive/cwc-podcast/.venv/lib/python3.14/site-packages/mlx_whisper/cli.pyoptional_int"build_parser.<locals>.optional_int   s    't8S[8    c                 *    V R 8X  d   R# \        V 4      # r
   )floatr   s   &r   optional_float$build_parser.<locals>.optional_float   s    't:U6]:r   c                 z    R RRR/pW9   d	   W,          # \        R\        VP                  4       4       RV  24      h)TrueTFalseFzExpected one of z, got )
ValueErrorsetkeys)r   str2vals   & r   str2boolbuild_parser.<locals>.str2bool   sC    4%0?"/GLLN0C/DF6(STTr   )formatter_classr   +zAudio file(s) to transcribe)nargshelpz--modelzmlx-community/whisper-tinyz(The model directory or hugging face repo)defaulttyper#   z--output-nameNzTThe name of transcription/translation output files before --output-format extensions)r%   r$   r#   z--output-dirz-o.zDirectory to save the outputsz--output-formatz-ftxtzFormat of the output file)r%   r$   choicesr#   z	--verboseTz0Whether to print out progress and debug messagesz--taskr   	translatezMPerform speech recognition ('transcribe') or speech translation ('translate')z
--languagez9Language spoken in the audio, specify None to auto-detectz--temperaturezTemperature for samplingz	--best-ofz<Number of candidates when sampling with non-zero temperaturez
--patiencezOptional patience value to use in beam decoding, as in https://arxiv.org/abs/2204.05424, the default (1.0) is equivalent to conventional beam searchz--length-penaltyzOptional token length penalty coefficient (alpha) as in https://arxiv.org/abs/1609.08144, uses simple length normalization by default.z--suppress-tokensz-1zComma-separated list of token ids to suppress during sampling; '-1' will suppress most special characters except common punctuationsz--initial-promptz:Optional text to provide as a prompt for the first window.z--condition-on-previous-textzIf True, provide the previous output of the model as a prompt for the next window; disabling may make the text inconsistent across windows, but the model becomes less prone to getting stuck in a failure loopz--fp16z$Whether to perform inference in fp16z--compression-ratio-thresholdg333333@zUif the gzip compression ratio is higher than this value, treat the decoding as failedz--logprob-thresholdzUIf the average log probability is lower than this value, treat the decoding as failedz--no-speech-thresholdg333333?zIf the probability of the token is higher than this value the decoding has failed due to `logprob_threshold`, consider the segment as silencez--word-timestampsFzBExtract word-level timestamps and refine the results based on themz--prepend-punctuationsu   "'“¿([{-zNIf word-timestamps is True, merge these punctuation symbols with the next wordz--append-punctuationsu   "'.。,，!！?？:：”)]}、zRIf word_timestamps is True, merge these punctuation symbols with the previous wordz--highlight-wordszT(requires --word_timestamps True) underline each word as it is spoken in srt and vttz--max-line-widthze(requires --word_timestamps True) the maximum number of characters in a line before breaking the linez--max-line-countzJ(requires --word_timestamps True) the maximum number of lines in a segmentz--max-words-per-linezk(requires --word_timestamps True, no effect with --max_line_width) the maximum number of words in a segmentz!--hallucination-silence-thresholdz(requires --word_timestamps True) skip silent periods longer than this threshold (in seconds) when a possible hallucination is detected)r%   r#   z--clip-timestamps0zComma-separated list start,end,start,end,... timestamps (in seconds) of clips to process, where the last end timestamp defaults to the end of the file)r'   vttsrttsvjsonallg      )argparseArgumentParserArgumentDefaultsHelpFormatteradd_argumentstrsortedr   r   r   titler   r   )r   r   r   parserks        r   build_parserr9      s)   9;U $$ >>F s1NO
,7	   )   ,   ;(   ?	   {+\   y~~'(
%5%:%:%<=%<'')%<=
>?H   eQ5O   K	    d	    V	    T	   I	   & _	   3	   'd	   d	    ]	   Q	    ]	   2a	   c	   t	   Y	   z	   + W  
  f	   Mo >s   (L$c                     \        4       p \        V P                  4       4      pVR ,          RJ d   \        RV 24       VP	                  R4      pVP	                  R4      pVP	                  R4      pVP	                  R4      p\
        P                  ! VRR7       \        WC4      p. ROpV Uu/ uF  qVP	                  V4      bK  	  p	pVR,          '       gK   V	P                  4        F6  w  rV'       g   K  V
P                  RR4      pV P                  RV R24       K8  	  V	R,          '       d&   V	R	,          '       g   \        P                  ! R4       V	R
,          '       d&   V	R	,          '       d   \        P                  ! R4       VP	                  R4       Fp  pVR8X  d%   \        P                  ! RR7      pT;'       g    RpM*T;'       g!    \        P                   ! V4      P"                  p \%        V3RV/VB pV! W3/ V	B  Kr  	  R# u upi   \&         dQ   p\(        P*                  ! 4        \        RT R\-        T4      P.                   R\1        T4       24        Rp?K  Rp?ii ; i)verboseTzArgs: model
output_diroutput_formatoutput_name)exist_okmax_line_countmax_line_widthmax_words_per_lineword_timestamps_-z--z  requires --word-timestamps Truez7--max-line-count has no effect without --max-line-widthz8--max-words-per-line has no effect with --max-line-widthr   )
from_stdincontentpath_or_hf_repoz	Skipping z due to z: N)highlight_wordsrA   rB   rC   )r9   vars
parse_argsprintpoposmakedirsr   itemsreplaceerrorwarningswarnr   
load_audiopathlibPathstemr   	Exception	traceback	print_excr%   __name__r4   )r7   argsrI   r=   r>   r?   writerword_optionsargwriter_argsr8   vargop	audio_objresultes                   r   mainrh      s   ^F!!#$DI$tfo88G,Ohh|,J/2Mxx.KKK
T*2FL 2>>#%K>!""%%'DAq		#s+r%(HIJ ( #$$[9I-J-JOP'(([9I-J-JPQXXg&	((D9I%22K%EEi)@)E)EK		O / F
 66+6 ' ?4  	O!Ii[a1A1A0B"SVHMNN	Os   .H5HI2"AI--I2__main__)r0   rO   rW   r[   rT    r   	tokenizerr   r   r   writersr   r9   rh   r]    r   r   <module>rn      sD     	     2 " {|/Od zF r   