
    C1iR                        S SK r S SKrS SKrS SKJrJrJr  S SKrS SKJ	r	  0 SS_SS_SS	_S
S_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS _S!S"_S#S$_S%S%S&.Er
S'\\   4S( jrS) rS* r     S:S+\S,\\   S-\S.\\   S/\\   S0\\\\4      4S1 jjr  S;S2\S3\S4\S'\4S5 jjr " S6 S7\	5      rS8\\   S'\\   4S9 jrg)<    N)ListOptionalUnion)tqdmztiny.enzSystran/faster-whisper-tiny.entinyzSystran/faster-whisper-tinyzbase.enzSystran/faster-whisper-base.enbasezSystran/faster-whisper-basezsmall.enzSystran/faster-whisper-small.ensmallzSystran/faster-whisper-smallz	medium.enz Systran/faster-whisper-medium.enmediumzSystran/faster-whisper-mediumzlarge-v1zSystran/faster-whisper-large-v1zlarge-v2zSystran/faster-whisper-large-v2zlarge-v3zSystran/faster-whisper-large-v3largezdistil-large-v2z&Systran/faster-distil-whisper-large-v2zdistil-medium.enz'Systran/faster-distil-whisper-medium.enzdistil-small.enz&Systran/faster-distil-whisper-small.enzdistil-large-v3z&Systran/faster-distil-whisper-large-v3zdistil-large-v3.5z$distil-whisper/distil-large-v3.5-ct2z,mobiuslabsgmbh/faster-whisper-large-v3-turbo)zlarge-v3-turboturboreturnc                  <    [        [        R                  5       5      $ )z&Returns the names of available models.)list_MODELSkeys     N/home/james-whalen/.local/lib/python3.13/site-packages/faster_whisper/utils.pyavailable_modelsr   "   s    r   c                      [         R                  R                  [         R                  R                  [         R                  R	                  [
        5      5      S5      $ )z)Returns the path to the assets directory.assets)ospathjoindirnameabspath__file__r   r   r   get_assets_pathr   '   s1    77<<(ABHMMr   c                  .    [         R                  " S5      $ )zReturns the module logger.faster_whisper)logging	getLoggerr   r   r   
get_loggerr#   ,   s    -..r   
size_or_id
output_dirlocal_files_only	cache_dirrevisionuse_auth_tokenc           	      X   [         R                  " SU 5      (       a  U nOL[        R                  U 5      nUc4  [	        SU < SSR                  [        R                  5       5      < 35      e/ SQnUU[        US.nUb	  XS'   SUS	'   Ub  X8S
'   Ub  XXS'   [        R                  " U40 UD6$ )a,  Downloads a CTranslate2 Whisper model from the Hugging Face Hub.

Args:
  size_or_id: Size of the model to download from https://huggingface.co/Systran
    (tiny, tiny.en, base, base.en, small, small.en, distil-small.en, medium, medium.en,
    distil-medium.en, large-v1, large-v2, large-v3, large, distil-large-v2,
    distil-large-v3), or a CTranslate2-converted model ID from the Hugging Face Hub
    (e.g. Systran/faster-whisper-large-v3).
  output_dir: Directory where the model should be saved. If not set, the model is saved in
    the cache directory.
  local_files_only:  If True, avoid downloading the file and return the path to the local
    cached file if it exists.
  cache_dir: Path to the folder where cached files are stored.
  revision: An optional Git revision id which can be a branch name, a tag, or a
        commit hash.
  use_auth_token: HuggingFace authentication token or True to use the
        token stored by the HuggingFace config folder.

Returns:
  The path to the downloaded model.

Raises:
  ValueError: if the model size is invalid.
z.*/.*zInvalid model size 'z', expected one of: z, )zconfig.jsonzpreprocessor_config.jsonz	model.binztokenizer.jsonzvocabulary.*)r&   allow_patterns
tqdm_classr(   	local_dirFlocal_dir_use_symlinksr'   token)
rematchr   get
ValueErrorr   r   disabled_tqdmhuggingface_hubsnapshot_download)	r$   r%   r&   r'   r(   r)   repo_idr+   kwargss	            r   download_modelr9   1   s    @ 
xx*%%++j)?tyy8: 
N -(#	F ({+0'('{!(w,,W???r   secondsalways_include_hoursdecimal_markerc                     U S:  d   S5       e[        U S-  5      nUS-  nX4S-  -  nUS-  nX5S-  -  nUS-  n X0S-  -  nU(       d  US:  a  US S3OS	nU US SU S U US
 3$ )Nr   znon-negative timestamp expectedg     @@i6 i`  i  02d: 03d)round)r:   r;   r<   millisecondshoursminuteshours_markers          r   format_timestamprG   w   s    
 a<:::<6)*LI%EI%%Lf$Gf$$Le#GeO#L&:eaieC[?RL.QwsmN3CLQTCUVr   c                   (   ^  \ rS rSrU 4S jrSrU =r$ )r4      c                 0   > SUS'   [         TU ]  " U0 UD6  g )NTdisable)super__init__)selfargsr8   	__class__s      r   rM   disabled_tqdm.__init__   s     y$)&)r   r   )__name__
__module____qualname____firstlineno__rM   __static_attributes____classcell__)rP   s   @r   r4   r4      s    * *r   r4   segmentsc                 `    [        S [        U 5       5       U (       a  U S   S   5      $ S 5      $ )Nc              3   V   #    U  H  n[        US    5        H	  o"S   v   M     M!     g7f)wordsendN)reversed).0sws      r   	<genexpr>get_end.<locals>.<genexpr>   s&     L-ax'
7K!57K-s   ')r\   )nextr]   )rX   s    r   get_endre      s7    L8H-L'U -1 r   )NFNNN)F.)r!   r   r0   typingr   r   r   r5   	tqdm.autor   r   strr   r   r#   boolr9   floatrG   r4   dictre   r   r   r   <module>rm      s    	 	 ( (  /
) / )	
 1 + 3 - 1 1 1 . ? A ?  ?!" ?#$ E;'. $s)  
N
/ !%"#"15C@C@C@ C@ }	C@
 smC@ U39-.C@P "'  		.*D *d4j Xe_ r   