+
    QV-jüÂ  ã                   ó  € R t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	t	^ RI
t
^ RIt^ RIt^ RIHtHt ^ RIHt ^ RIHt ^ RIHtHtHt ^ RIt^RIHtHtHtHtHtHtH t H!t!H"t"H#t#H$t$H%t%H&t&H't'H(t(H)t)H*t* ])PV                  ! ],4      t-] ! 4       '       d   ^ RI.t.^ RI/H0t1 ]! 4       '       d   ] ! 4       '       d	   ^ RI2H3t3H4t4 R	 t5R
 t6R t7R R lt8RLR R llt9RLR R llt: ! R R4      t; ! R R]4      t< ! R R]4      t= ! R R]4      t>Rt?]	P€                  ! R]?,           R,           4      tAR tB]?RR3R R  lltCRRR]?3R! R" lltD ! R# R$]4      tE ! R% R&]4      tF ! R' R(]4      tG ! R) R*]4      tHR+ R, ltIR- R. ltJR/ R0 ltKR1 R2 ltL ! R3 R4]4      tMR5 tNR6 tORMR7 ltP ! R8 R9]4      tQ ! R: R;4      tRR< R= ltSR> tTR? tURNR@ RA lltV ! RB RC]4      tW ! RD RE4      tXRLRF RG lltYRORH ltZRI t[RJ t\]Pº                  RK 4       t^R# )Pz6
PyTorch-independent utilities for the Trainer class.
N)ÚCallableÚSized)Úpartial)ÚPath)ÚAnyÚ
NamedTupleÚ	TypeGuard)ÚSAFE_WEIGHTS_INDEX_NAMEÚWEIGHTS_INDEX_NAMEÚExplicitEnumÚcheck_torch_load_is_safeÚis_peft_availableÚis_psutil_availableÚis_torch_availableÚis_torch_cuda_availableÚis_torch_hpu_availableÚis_torch_mlu_availableÚis_torch_mps_availableÚis_torch_musa_availableÚis_torch_npu_availableÚis_torch_xla_availableÚis_torch_xpu_availableÚloggingÚrequires_backends)Ú	load_file)ÚPeftMixedModelÚ	PeftModelc                 óR   € \        4       '       d   \        V \        \        34      # R # ©F)r   Ú
isinstancer   r   ©Úmodels   &Úk/Volumes/fast/ai/experiments/ui-tars-smoke/.venv/lib/python3.14/site-packages/transformers/trainer_utils.pyÚ_is_peft_modelr#   E   s    € Ü×ÒÜ˜%¤)¬^Ð!<Ó=Ð=Ùó    c                ó
  € \        V 4      '       g   V # \        V R4      '       d   V P                  4       # \        V R4      '       d3   \        V P                  R4      '       d   V P                  P                  # \        R4      h)a„  
Extract the base model from a PEFT-wrapped model.

If the model is not a PEFT model, returns it unchanged. Otherwise, attempts to
unwrap the base model using ``get_base_model()`` or the ``base_model.model`` attribute.

Args:
    model: The model to unwrap.

Returns:
    The unwrapped base model.

Raises:
    AttributeError: If the model is a PEFT model but cannot be unwrapped safely.
Úget_base_modelÚ
base_modelr!   z8Cannot extract base model safely from this PEFT wrapper.)r#   Úhasattrr&   r'   r!   ÚAttributeErrorr    s   &r"   Úunwrap_peft_modelr*   K   sn   € ô  ˜%× Ò ØˆÜˆuÐ&×'Ò'Ø×#Ñ#Ó%Ð%Ü	�˜×	%Ò	%¬'°%×2BÑ2BÀG×*LÒ*Là×Ñ×%Ñ%Ð%äÐWÓXÐXr$   c                ój  € \        V RR4      ;'       d    \        V RR4      '       * p\        V RR4      RJ;'       d    V P                  P                  p\        V RR4      RJ;'       d    \        V P                  RR4      pV'       d   \        V R4      '       d   \	        R4      hV'       d%   \        V 4      '       g   V'       g   \	        R	4      hV'       dX   V'       gN   \	        R
V P                  P                  P                   RV P                  P                  P                   24      hR# R# )as  
Validate that a quantized model is set up correctly for training.

Raises `ValueError` when:
- A quantized + compiled model is used (torch.compile is not supported with PEFT fine-tuning).
- A purely quantized model has no trainable adapters attached (unless it supports QAT).
- The quantization method does not support training.

Args:
    model: The model to validate.
Úis_quantizedFÚ_hf_peft_config_loadedÚhf_quantizerNÚis_qat_trainableÚ	_orig_modz�You cannot fine-tune quantized model with `torch.compile()` make sure to pass a non-compiled model when fine-tuning a quantized model with PEFTzæYou cannot perform fine-tuning on purely quantized models. Please attach trainable adapters on top of the quantized model to correctly perform fine-tuning. Please see: https://huggingface.co/docs/transformers/peft for more detailsz8The model you are trying to fine-tune is quantized with z³ but that quantization method do not support training. Please open an issue on GitHub: https://github.com/huggingface/transformers to request the support for training support for )Úgetattrr.   Úis_trainabler(   Ú
ValueErrorr#   Úquantization_configÚquant_method)r!   Ú_is_quantized_and_base_modelÚ&_quantization_method_supports_trainingÚ%_is_model_quantized_and_qat_trainables   &   r"   Ú"validate_quantization_for_trainingr9   f   s<  € ô $+¨5°.À%Ó#H÷ $ð $ÔQXØÐ'¨óRô NÐ ô 	��~ tÓ,°DÐ8×\Ð\¸U×=OÑ=O×=\Ñ=\ð +ô -4°E¸>È4Ó,PÐX\Ð,\÷ -ð -ÔahØ×ÑÐ.°óbÐ)÷
 $¬°°{×(CÒ(CÜð ^ó
ð 	
÷
 $¬N¸5×,AÒ,A×JoÜð ó
ð 	
÷
 
&×.TÜØFÀu×GYÑGY×GmÑGm×GzÑGzÐF{ð@Ø@E×@RÑ@R×@fÑ@f×@sÑ@sÐ?tðvó
ð 	
ñ /UÑ	%r$   c                ó<   € V ^8„  d   QhR\         R\         R\         /# )é   Ú	worker_idÚnum_workersÚrank)Úint)Úformats   "r"   Ú__annotate__rA   ‘   s!   € ÷ ñ œ3ð ¬Sð ¼ñ r$   c                ór   € \         P                  ! 4       R,          pW,          V,           p\        V4       R# )zF
Helper function to set worker seed during Dataloader initialization.
Nl        )ÚtorchÚinitial_seedÚset_seed)r<   r=   r>   Ú	init_seedÚworker_seeds   &&&  r"   Úseed_workerrH   ‘   s,   € ô ×"Ò"Ó$ uÕ,€IØÕ$ yÕ0€KÜˆ[Ör$   Fc                ó0   € V ^8„  d   QhR\         R\        /# )r;   ÚseedÚ	warn_only©r?   Úbool)r@   s   "r"   rA   rA   š   s   € ÷ /ñ /¤#ð /´$ñ /r$   c                óª  € \        V 4       \        4       '       d¸   R\        P                  R&   R\        P                  R&   R\        P                  R&   R\        P                  R&   R\        P                  R&   \        P
                  ! RVR	7       R\        P                  P                  n        R
\        P                  P                  n	        R# R# )zŽ
Helper function for reproducible behavior during distributed training. See
https://pytorch.org/docs/stable/notes/randomness.html for pytorch
Ú1ÚCUDA_LAUNCH_BLOCKINGz:16:8ÚCUBLAS_WORKSPACE_CONFIGÚASCEND_LAUNCH_BLOCKINGÚHCCL_DETERMINISTICÚFLASH_ATTENTION_DETERMINISTICT)rK   FN)
rE   r   ÚosÚenvironrC   Úuse_deterministic_algorithmsÚbackendsÚcudnnÚdeterministicÚ	benchmark)rJ   rK   s   &&r"   Úenable_full_determinismr\   š   sœ   € ô ˆT„Nä×Òð .1Œ�
‰
Ð)Ñ*Ø07Œ�
‰
Ð,Ñ-à/2Œ�
‰
Ð+Ñ,Ø+.Œ�
‰
Ð'Ñ(à69Œ�
‰
Ð2Ñ3Ü×*Ò*¨4¸9ÕEð .2Œ�‰×ÑÔ*Ø).Œ�‰×ÑÖ&ñ r$   c                ó0   € V ^8„  d   QhR\         R\        /# )r;   rJ   rZ   rL   )r@   s   "r"   rA   rA   ´   s   € ÷ (ñ (”3ð (¤tñ (r$   c                ó  € \         P                  ! V 4       \        P                   P                  V 4       \        4       '       dT   \        P
                  ! V 4       \        P                  P                  V 4       V'       d   \        P                  ! R4       \        4       '       d    \        P                  P                  V 4       \        4       '       d    \        P                  P                  V 4       \        4       '       d    \        P                  P                  V 4       \        4       '       d    \        P                   P                  V 4       \#        4       '       d"   \        P$                  P                  V 4       R# R# )a1  
Helper function for reproducible behavior to set the seed in `random`, `numpy`, `torch` (if installed).

Args:
    seed (`int`):
        The seed to set.
    deterministic (`bool`, *optional*, defaults to `False`):
        Whether to use deterministic algorithms where available. Can slow down training.
TN)ÚrandomrJ   Únpr   rC   Úmanual_seedÚcudaÚmanual_seed_allrW   r   Úmlur   Úmusar   Únpur   Úhpur   Úxpu)rJ   rZ   s   &&r"   rE   rE   ´   sæ   € ô ‡K‚K�ÔÜ‡I�I‡N�N�4ÔÜ×ÒÜ×Ò˜$ÔÜ�
‰
×"Ñ" 4Ô(çÜ×.Ò.¨tÔ4Ü×ÒÜ�	‰	×!Ñ! $Ô'Ü× Ò Ü�
‰
×"Ñ" 4Ô(Ü×ÒÜ�	‰	×!Ñ! $Ô'Ü×ÒÜ�	‰	×!Ñ! $Ô'Ü×ÒÜ�	‰	×!Ñ! $Ö'ñ  r$   c                   óF   a € ] tR t^Òt o RtRV 3R lR lltR tR tRtV t	R# )	ÚEvalPredictiona^  
Evaluation output (always contains labels), to be used to compute metrics.

Parameters:
    predictions (`np.ndarray`): Predictions of the model.
    label_ids (`np.ndarray`): Targets to be matched.
    inputs (`np.ndarray`, *optional*): Input data passed to the model.
    losses (`np.ndarray`, *optional*): Loss values computed during evaluation.
Nc          
      ón  <€ V ^8„  d   QhRS[ P                  S[S[ P                  ,          ,          RS[ P                  S[S[ P                  ,          ,          RS[ P                  S[S[ P                  ,          ,          R,          RS[ P                  S[S[ P                  ,          ,          R,          /# )r;   ÚpredictionsÚ	label_idsÚinputsNÚlosses)r`   ÚndarrayÚtuple)r@   Ú__classdict__s   "€r"   rA   ÚEvalPrediction.__annotate__Ý   s…   ø€ ÷ ,ñ ,á—Z‘Z¡%©¯
©
Õ"3Õ3ð,ñ —:‘:¡¡b§j¡jÕ 1Õ1ð,ñ —
‘
™U¡2§:¡:Õ.Õ.°Õ5ð	,ñ
 —
‘
™U¡2§:¡:Õ.Õ.°Õ5ñ,r$   c                ó<  € Wn         W n        W0n        W@n        V P                   V P                  3V n        V P                  e%   V ;P                  V P                  3,          un        V P                  e'   V ;P                  V P                  3,          un        R # R # ©N)rl   rm   rn   ro   Úelements)Úselfrl   rm   rn   ro   s   &&&&&r"   Ú__init__ÚEvalPrediction.__init__Ý   sp   € ð 'ÔØ"ŒØŒØŒØ×)Ñ)¨4¯>©>Ð:ˆŒØ�;‰;Ò"Ø�MŠM˜dŸk™k˜^Õ+�MØ�;‰;Ò"Ø�MŠM˜dŸk™k˜^Õ+�Mñ #r$   c                ó,   € \        V P                  4      # ru   )Úiterrv   ©rw   s   &r"   Ú__iter__ÚEvalPrediction.__iter__î   s   € Ü�D—M‘MÓ"Ð"r$   c                ó€   € V^ 8  g   V\        V P                  4      8¼  d   \        R4      hV P                  V,          # )é    ztuple index out of range)Úlenrv   Ú
IndexError)rw   Úidxs   &&r"   Ú__getitem__ÚEvalPrediction.__getitem__ñ   s4   € Ø�Œ7�cœS §¡Ó/Ô/ÜÐ7Ó8Ð8Ø�}‰}˜SÕ!Ð!r$   )rv   rn   rm   ro   rl   )NN)
Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__rx   r}   r„   Ú__static_attributes__Ú__classdictcell__©rr   s   @r"   rj   rj   Ò   s#   ø‡ € ñ÷,ò ,ò"#÷"ð "r$   rj   c                   ó,   a € ] tR t^÷t o V 3R ltRtV tR# )ÚEvalLoopOutputc                ó  <€ V ^8„  d   Qh/ S[ P                  S[S[ P                  ,          ,          ;R&   S[ P                  S[S[ P                  ,          ,          R,          ;R&   S[S[S[3,          R,          ;R&   S[R,          ;R&   # )r;   rl   Nrm   ÚmetricsÚnum_samples)r`   rp   rq   ÚdictÚstrÚfloatr?   )r@   rr   s   "€r"   rA   ÚEvalLoopOutput.__annotate__÷   sp   ø‡ ‚ Ù—‘™e¡B§J¡JÕ/Õ/Ñ/ñ á�z‰z™E¡"§*¡*Õ-Õ-°Õ4Ñ4ñ ñ ‘#‘u�*Õ Õ$Ñ$ñ ñ �t•Ñò	 r$   © N©r†   r‡   rˆ   r‰   Ú__annotate_func__r‹   rŒ   r�   s   @r"   r�   r�   ÷   ó   ø‡ ‡ „ r$   r�   c                   ó,   a € ] tR t^þt o V 3R ltRtV tR# )ÚPredictionOutputc                ó   <€ V ^8„  d   Qh/ S[ P                  S[S[ P                  ,          ,          ;R&   S[ P                  S[S[ P                  ,          ,          R,          ;R&   S[S[S[3,          R,          ;R&   # )r;   rl   Nrm   r‘   )r`   rp   rq   r“   r”   r•   )r@   rr   s   "€r"   rA   ÚPredictionOutput.__annotate__þ   s_   ø‡ ‚ Ù—‘™e¡B§J¡JÕ/Õ/Ñ/ñ á�z‰z™E¡"§*¡*Õ-Õ-°Õ4Ñ4ñ ñ ‘#‘u�*Õ Õ$Ñ$ò r$   r—   Nr˜   r�   s   @r"   rœ   rœ   þ   rš   r$   rœ   c                   ó,   a € ] tR tRt o V 3R ltRtV tR# )ÚTrainOutputi  c                óT   <€ V ^8„  d   Qh/ S[ ;R&   S[;R&   S[S[S[3,          ;R&   # )r;   Úglobal_stepÚtraining_lossr‘   )r?   r•   r“   r”   )r@   rr   s   "€r"   rA   ÚTrainOutput.__annotate__  s1   ø‡ ‚ ÙÑñ áÑñ ñ ‘#‘u�*ÕÑò r$   r—   Nr˜   r�   s   @r"   r    r      rš   r$   r    Ú
checkpointÚ^z\-(\d+)$c           	      ó�  € \         P                  ! V 4      pV Uu. uFb  p\        P                  V4      f   K  \         P                  P                  \         P                  P                  W4      4      '       g   K`  VNKd  	  pp\        V4      ^ 8X  d   R # \         P                  P                  V \        VR R7      4      # u upi )Nc                 óh   € \        \        P                  V 4      P                  4       ^ ,          4      # )r€   )r?   Ú_re_checkpointÚsearchÚgroups)Úxs   &r"   Ú<lambda>Ú%get_last_checkpoint.<locals>.<lambda>  s$   € ¼sÄ>×CXÑCXÐYZÓC[×CbÑCbÓCdÐefÕCgÔ?hr$   )Úkey)	rU   Úlistdirr©   rª   ÚpathÚisdirÚjoinr�   Úmax)ÚfolderÚcontentr±   Úcheckpointss   &   r"   Úget_last_checkpointr¸     s™   € Ü�jŠj˜Ó €Gñ óáˆDÜ× Ñ  Ó&ô 	ä79·w±w·}±}ÄRÇWÁWÇ\Á\ÐRXÓE_×7`÷ 	ˆÙð ð ô
 ˆ;Ó˜1ÔÙÜ�7‰7�<‰<˜¤ KÑ5hÔ iÓjÐjùòs   ›C¹?CÁ=Cc                óx   € V ^8„  d   QhR\         R\         R\        R\         R,          R\        \         ,          /# )r;   Ú
output_dirÚcheckpoint_prefixÚ	use_mtimeÚbest_model_checkpointNÚreturn)r”   rM   Úlist)r@   s   "r"   rA   rA     sB   € ÷ 9ñ 9Üð9äð9ô ð9ô  �:ð	9ô
 
Œ#…Yñ9r$   c                óô  € \        V 4      P                  V R24       Uu. uF5  p\        P                  P	                  V4      '       g   K*  \        V4      NK7  	  pp. pV F£  pV'       d3   VP                  \        P                  P                  V4      V34       K=  \        P                  ! RV R2V4      pVf   K^  VP                  4       f   Kr  VP                  \        VP                  4       ^ ,          4      V34       K¥  	  \        V4      p	V'       d`   \        V	4      ^8”  dP   V	R,          ^ ,          V	^ ,          ^ ,          ,
          p
V
R8  d$   \        P                  R4       \!        WRVR7      # V	 UUu. uF  w  r·VNK	  	  p	ppVeV   \        \        V4      4      pW99   d<   V	R,          V8w  d.   V	R,          pV	 Uu. uF  qÝW<09  g   K  VNK  	  p	pW“V.,          p	V	# u upi u uppi u upi )	aÀ  
Return checkpoint directories sorted by step number (oldest first).

Args:
    output_dir (`str`):
        The directory containing the checkpoints.
    checkpoint_prefix (`str`, *optional*, defaults to `"checkpoint"`):
        The prefix used for checkpoint directory names.
    use_mtime (`bool`, *optional*, defaults to `False`):
        Whether to sort by modification time instead of step number.
    best_model_checkpoint (`str`, *optional*):
        If provided, this checkpoint is moved to second-to-last position to protect
        it from deletion while keeping the most recent checkpoint last for resuming.

Returns:
    `list[str]`: Sorted list of checkpoint directory paths (oldest first).
z-*z.*z	-([0-9]+)g      ð?zPmtime may not be reliable on this filesystem, falling back to numerical orderingF)r¼   r½   éÿÿÿÿ)r   ÚglobrU   r±   r²   r”   ÚappendÚgetmtimeÚreÚmatchr«   r?   Úsortedr�   ÚloggerÚwarning_onceÚsort_checkpoints)rº   r»   r¼   r½   r¬   Úglob_checkpointsÚordering_and_checkpoint_pathr±   Úregex_matchÚcheckpoints_sortedÚ
mtime_diffÚ_Úmost_recentÚcs   &&&&          r"   rÊ   rÊ     sâ  € ô. )-¨ZÓ(8×(=Ñ(=ÐARÐ@SÐSUÐ>VÔ(WÓlÑ(W 1Ô[]×[bÑ[b×[hÑ[hÐij×[kœœ˜AžÑ(WÐÐlà#%Ð Û ˆßØ(×/Ñ/´·±×1AÑ1AÀ$Ó1GÈÐ0NÖOäŸ(š( RÐ(9Ð':¸)Ð#DÀdÓKˆKØÔ&¨;×+=Ñ+=Ó+?Ô+KØ,×3Ñ3´S¸×9KÑ9KÓ9MÈaÕ9PÓ5QÐSWÐ4XÖYñ !ô  Ð <Ó=Ð÷ ”SÐ+Ó,¨qÔ0Ø'¨Õ+¨AÕ.Ð1CÀAÕ1FÀqÕ1IÕIˆ
Ø˜ÔÜ×ÑÐ rÔsÜ#Ø¸ÐVkôð ñ /AÔAÑ.@¡7 1›$Ñ.@ÐÑAð Ò(Ü #¤DÐ)>Ó$?Ó @ÐØ Ô6Ð;MÈbÕ;QÐUjÔ;jØ,¨RÕ0ˆKÙ-?Ó!qÑ-?¨ÐMbÐLpÑCp§! !Ñ-?ÐÐ!qØ¸+Ð"FÕFÐàÐùòE mùó. Bùò "rs    'G*ÁG*Å?G/Ç	G5ÇG5c                ót   € V ^8„  d   QhR\         R\        R,          R\         R,          R\        R\         RR/# )r;   rº   Úsave_total_limitNr½   r¼   r»   r¾   )r”   r?   rM   )r@   s   "r"   rA   rA   V  sL   € ÷ ,ñ ,Üð,ä˜D•jð,ô  �:ð,ô ð	,ô
 ð,ð 
ñ,r$   c                ót  € Ve   V^ 8:  d   R# \        WV4      p\        V4      V8:  d   R# VR,          0pVe$   VP                  \        \	        V4      4      4       \        V\        V4      4      p\        V4      pV F5  p	W‡8:  d    R# W–9  g   K  \        P                  ! V	RR7       V^,          pK7  	  R# )aÊ  
Delete older checkpoints, keeping at most `save_total_limit`.

Always preserves the most recent checkpoint and the best model checkpoint (if provided).

Args:
    output_dir (`str`):
        The directory containing the checkpoints.
    save_total_limit (`int`, *optional*):
        Maximum number of checkpoints to keep. No deletion if `None` or <= 0.
    best_model_checkpoint (`str`, *optional*):
        Path to best checkpoint (will always be preserved).
    use_mtime (`bool`, *optional*, defaults to `False`):
        Whether to sort by modification time instead of step number.
    checkpoint_prefix (`str`, *optional*, defaults to `"checkpoint"`):
        The prefix used for checkpoint directory names.
NT)Úignore_errorsrÁ   )rÊ   r�   Úaddr”   r   r´   ÚshutilÚrmtree)
rº   rÔ   r½   r¼   r»   r·   Ú	protectedÚnum_to_keepÚ	remainingr¥   s
   &&&&&     r"   Úrotate_checkpointsrÝ   V  sª   € ð0 ÒÐ#3°qÔ#8Ùä" :À)ÓL€KÜ
ˆ;ÓÐ+Ô+Ùð ˜R•Ð!€IØÒ(Ø�‰”cœ$Ð4Ó5Ó6Ô7ô Ð&¬¨I«Ó7€KÜ�KÓ €IÛ!ˆ
ØÔ#ÚØÖ&Ü�MŠM˜*°DÕ9Ø˜�NŠIó "r$   c                   ó"   € ] tR tRtRtRtRtRtR# )ÚIntervalStrategyi…  ÚnoÚstepsÚepochr—   N)r†   r‡   rˆ   r‰   ÚNOÚSTEPSÚEPOCHr‹   r—   r$   r"   rß   rß   …  s   † Ø	€BØ€EØ„Er$   rß   c                   ó&   € ] tR tRtRtRtRtRtRtR# )ÚSaveStrategyi‹  rà   rá   râ   Úbestr—   N)	r†   r‡   rˆ   r‰   rã   rä   rå   ÚBESTr‹   r—   r$   r"   rç   rç   ‹  s   † Ø	€BØ€EØ€EØ„Dr$   rç   c                   ó&   € ] tR tRtRtRtRtRtRtR# )ÚHubStrategyi’  ÚendÚ
every_saver¥   Úall_checkpointsr—   N)	r†   r‡   rˆ   r‰   ÚENDÚ
EVERY_SAVEÚ
CHECKPOINTÚALL_CHECKPOINTSr‹   r—   r$   r"   rë   rë   ’  s   † Ø
€CØ€JØ€JØ'„Or$   rë   c                   ó4   a € ] tR tRt o RtRtV 3R ltRtV tR# )ÚBestRuni™  a3  
The best run found by a hyperparameter search (see [`~Trainer.hyperparameter_search`]).

Parameters:
    run_id (`str`):
        The id of the best run (if models were saved, the corresponding checkpoint will be in the folder ending
        with run-{run_id}).
    objective (`float`):
        The objective that was obtained for this run.
    hyperparameters (`dict[str, Any]`):
        The hyperparameters picked to get this run.
    run_summary (`Optional[Any]`):
        A summary of tuning experiments. `ray.tune.ExperimentAnalysis` object for Ray backend.
Nc                óŽ   <€ V ^8„  d   Qh/ S[ ;R&   S[S[S[,          ,          ;R&   S[S[ S[3,          ;R&   S[R,          ;R&   # )r;   Úrun_idÚ	objectiveÚhyperparametersNÚrun_summary)r”   r•   r¿   r“   r   )r@   rr   s   "€r"   rA   ÚBestRun.__annotate__™  sM   ø‡ ‚ ñ  �Kñ! ñ" ‘t™E•{Õ"Ñ"ñ# ñ$ ™#™s˜(•^Ñ#ñ% ñ& �t•Ñ"ò' r$   r—   )	r†   r‡   rˆ   r‰   rŠ   rù   r™   r‹   rŒ   r�   s   @r"   rô   rô   ™  s   ø‡ € ñð$ #€K÷' ƒ r$   rô   c                óR   € V ^8„  d   QhR\         \        \        3,          R\        /# )r;   r‘   r¾   ©r“   r”   r•   )r@   s   "r"   rA   rA   ¯  s'   € ÷ @ñ @¤t¬C´¨JÕ'7ð @¼Eñ @r$   c                óŒ  € \         P                  ! V 4      p V P                  RR4      pV P                  RR4      pV  Uu. uF4  q3P                  R4      '       g   VP                  R4      '       g   K2  VNK6  	  ppV F  pV P                  VR4      pK  	  \	        V 4      ^ 8X  d   V# \        V P                  4       4      # u upi )aN  
The default objective to maximize/minimize when doing an hyperparameter search. It is the evaluation loss if no
metrics are provided to the [`Trainer`], the sum of all metrics otherwise.

Args:
    metrics (`dict[str, float]`): The metrics returned by the evaluate method.

Return:
    `float`: The objective to minimize or maximize
Ú	eval_lossNrâ   Ú_runtimeÚ_per_second)ÚcopyÚdeepcopyÚpopÚendswithr�   ÚsumÚvalues)r‘   ÚlossrÐ   ÚmÚspeed_metricsÚsms   &     r"   Údefault_compute_objectiver  ¯  s¢   € ô �mŠm˜GÓ$€GØ�;‰;�{ DÓ)€DØ�‰�G˜TÓ"€Aá 'Ó_¡˜1¯:©:°j×+AÒ+AÀQÇZÁZÐP]×E^—Q�Q¡€MÐ_ÛˆØ�K‰K˜˜DÓ!Šñ ä�w“< 1Ô$ˆ4Ð?¬#¨g¯n©nÓ.>Ó*?Ð?ùò `s   ¿/CÁ3Cc                óF   € V ^8„  d   QhR\         \        \        3,          /# ©r;   r¾   rü   )r@   s   "r"   rA   rA   Ä  s   € ÷ 
ñ 
¤d¬3´¨:Õ&6ñ 
r$   c                 óà   € ^RI Hp V! 4       '       g   \        R4      hRV P                  RRRRR7      RV P	                  R^^4      R	V P	                  R	^^(4      R
V P                  R
. RO4      /# )é   )Úis_optuna_availablez:This function needs Optuna installed: `pip install optuna`Úlearning_rateç�íµ ÷Æ°>ç-Cëâ6?T)ÚlogÚnum_train_epochsrJ   Úper_device_train_batch_size©é   é   é   é    é@   )Úintegrationsr  ÚImportErrorÚsuggest_floatÚsuggest_intÚsuggest_categorical)Útrialr  s   & r"   Údefault_hp_space_optunar#  Ä  sz   € Ý1á× Ò ÜÐVÓWÐWà˜×,Ñ,¨_¸dÀDÈdÐ,ÓSØ˜E×-Ñ-Ð.@À!ÀQÓGØ�×!Ñ! &¨!¨RÓ0Ø% u×'@Ñ'@ÐA^Ò`rÓ'sð	ð r$   c                óF   € V ^8„  d   QhR\         \        \        3,          /# r  ©r“   r”   r   )r@   s   "r"   rA   rA   Ñ  s   € ÷ ñ ¤4¬¬S¨¥>ñ r$   c                 ó  € ^RI Hp V! 4       '       g   \        R4      h^ RIHp RVP                  RR4      RVP                  \        \        ^^4      4      4      RVP                  ^^(4      R	VP                  . R
O4      /# )r  )Úis_ray_tune_availablez:This function needs ray installed: `pip install ray[tune]`)Útuner  r  r  r  rJ   r  r  )
r  r'  r  Úrayr(  Ú
loguniformÚchoicer¿   ÚrangeÚuniform)r"  r'  r(  s   &  r"   Údefault_hp_space_rayr.  Ñ  sq   € Ý3á ×"Ò"ÜÐVÓWÐWÝð 	˜Ÿ™¨¨tÓ4Ø˜DŸK™K¬¬U°1°a«[Ó(9Ó:Ø�—‘˜Q Ó#Ø% t§{¡{Ò3EÓ'Fð	ð r$   c                óF   € V ^8„  d   QhR\         \        \        3,          /# r  r%  )r@   s   "r"   rA   rA   à  s   € ÷ ñ ¤T¬#¬s¨(¥^ñ r$   c                 ó’   € ^RI Hp V! 4       '       g   \        R4      hRRRRRRR	/R
RRRRRRR/RRRR^R^/RRRR^R^(/RR. RO///# )r  )Úis_wandb_availablez8This function needs wandb installed: `pip install wandb`Úmethodr_   ÚmetricÚnamer÷   ÚgoalÚminimizeÚ
parametersr  Údistributionr-  Úminr  r´   r  r  Úint_uniformrJ   r  r  r  )r  r1  r  )r"  r1  s   & r"   Údefault_hp_space_wandbr;  à  sƒ   € Ý0á×ÒÜÐTÓUÐUð 	�(Ø�6˜;¨°
Ð;ØØ˜n¨i¸ÀÀeÈTÐRØ °ÀÀqÈ%ÐQRÐ SØ�^ ]°E¸1¸eÀRÐHØ)¨HÒ6HÐ+Ið	
ð	ð 	r$   c                   ó"   € ] tR tRtRtRtRtRtR# )ÚHPSearchBackendiò  Úoptunar)  Úwandbr—   N)r†   r‡   rˆ   r‰   ÚOPTUNAÚRAYÚWANDBr‹   r—   r$   r"   r=  r=  ò  s   † Ø€FØ
€CØ„Er$   r=  c                ó^   € \        4       '       d   ^ RIHp VP                  4       ^ 8H  # V R9   # )z�
Whether or not the current process is the local process, based on `xr.global_ordinal()` (for TPUs) first, then on
`local_rank`.
N)rÁ   r€   )r   Útorch_xla.runtimeÚruntimeÚglobal_ordinal)Ú
local_rankÚxrs   & r"   Úis_main_processrI  ø  s/   € ô
 ×ÒÝ&à× Ñ Ó" aÑ'Ð'Ø˜Ñ Ð r$   c                ó¼   € \        4       '       d   ^ RIHp VP                  4       # V R8w  d/   \	        4       '       d   ^ RIpVP                  P                  4       # ^# )z_
Return the number of processes launched in parallel. Works with `torch.distributed` and TPUs.
NrÁ   )r   rD  rE  Ú
world_sizer   rC   ÚdistributedÚget_world_size)rG  rH  rC   s   &  r"   Útotal_processes_numberrN    sH   € ô ×ÒÝ&à�}‰}‹ÐØ	�rÔ	Ô0×2Ò2Ûà× Ñ ×/Ñ/Ó1Ð1Ùr$   c                ó   € \         P                   ! 4       V,
          pV  R2\        V^4      /pV^ 8X  d   V# Ve   W%,          p\        V^4      W` R2&   Ve   W5,          p\        V^4      W` R2&   Ve   WE,          p	\        V	^4      W` R2&   V# )aÍ  
Measure and return speed performance metrics.

This function requires a time snapshot `start_time` before the operation to be measured starts and this function
should be run immediately after the operation to be measured has completed.

Args:
- split: name to prefix metric (like train, eval, test...)
- start_time: operation start time
- num_samples: number of samples processed
- num_steps: number of steps processed
- num_tokens: number of tokens processed
rÿ   Ú_samples_per_secondÚ_steps_per_secondÚ_tokens_per_second)ÚtimeÚround)
ÚsplitÚ
start_timer’   Ú	num_stepsÚ
num_tokensrE  ÚresultÚsamples_per_secondÚsteps_per_secondÚtokens_per_seconds
   &&&&&     r"   r	  r	    s²   € ô �iŠi‹k˜JÕ&€GØ��xÐ ¤%¨°Ó"3Ð4€FØ�!„|ØˆØÒØ(Õ2ÐÜ05Ð6HÈ!Ó0Lˆ�Ð+Ð,Ñ-ØÒØ$Õ.ÐÜ.3Ð4DÀaÓ.Hˆ�Ð)Ð*Ñ+ØÒØ&Õ0ÐÜ/4Ð5FÈÓ/Jˆ�Ð*Ð+Ñ,Ø€Mr$   c                   óJ   € ] tR tRtRtRtRtRtRtRt	Rt
R	tR
tRtRtRtRtRtR# )ÚSchedulerTypei1  a¿  
Scheduler names for the parameter `lr_scheduler_type` in [`TrainingArguments`].
By default, it uses "linear". Internally, this retrieves `get_linear_schedule_with_warmup` scheduler from [`Trainer`].
Scheduler types:
   - "linear" = [`get_linear_schedule_with_warmup`]
   - "cosine" = [`get_cosine_schedule_with_warmup`]
   - "cosine_with_restarts" = [`get_cosine_with_hard_restarts_schedule_with_warmup`]
   - "polynomial" = [`get_polynomial_decay_schedule_with_warmup`]
   - "constant" =  [`get_constant_schedule`]
   - "constant_with_warmup" = [`get_constant_schedule_with_warmup`]
   - "inverse_sqrt" = [`get_inverse_sqrt_schedule`]
   - "reduce_lr_on_plateau" = [`get_reduce_on_plateau_schedule`]
   - "cosine_with_min_lr" = [`get_cosine_with_min_lr_schedule_with_warmup`]
   - "cosine_warmup_with_min_lr" = [`get_cosine_with_min_lr_schedule_with_warmup_lr_rate`]
   - "warmup_stable_decay" = [`get_wsd_schedule`]
   - "greedy" = [`get_greedy_schedule`]
ÚlinearÚcosineÚcosine_with_restartsÚ
polynomialÚconstantÚconstant_with_warmupÚinverse_sqrtÚreduce_lr_on_plateauÚcosine_with_min_lrÚcosine_warmup_with_min_lrÚwarmup_stable_decayÚgreedyr—   N)r†   r‡   rˆ   r‰   rŠ   ÚLINEARÚCOSINEÚCOSINE_WITH_RESTARTSÚ
POLYNOMIALÚCONSTANTÚCONSTANT_WITH_WARMUPÚINVERSE_SQRTÚREDUCE_ON_PLATEAUÚCOSINE_WITH_MIN_LRÚCOSINE_WARMUP_WITH_MIN_LRÚWARMUP_STABLE_DECAYÚGREEDYr‹   r—   r$   r"   r^  r^  1  sK   † ñð$ €FØ€FØ1ÐØ€JØ€HØ1ÐØ!€LØ.ÐØ-ÐØ ;ÐØ/ÐØ„Fr$   r^  c                   óx   a € ] tR tRt o RtRRRRRRRRRR	R
R/tRR ltR tR tR t	R t
R tR tRR ltRtV tR# )ÚTrainerMemoryTrackeriR  aG  
A helper class that tracks cpu and gpu memory.

This class will silently skip unless `psutil` is available. Install with `pip install psutil`.

When a stage completes, it can pass metrics dict to update with the memory metrics gathered during this stage.

Example :

```python
self._memory_tracker = TrainerMemoryTracker(self.args.skip_memory_metrics)
self._memory_tracker.start()
# code ...
metrics = {"train_runtime": 10.5}
self._memory_tracker.stop_and_update_metrics(metrics)
```

To understand this class' intricacies please read the documentation of [`~Trainer.log_metrics`].
rx   ÚinitÚtrainÚ_inner_training_loopÚ_finalize_trainingÚevaluateÚevalÚpredictÚtestc                óf  € Wn         \        4       '       g   R V n         V P                   '       d   R# ^ RIp\        4       '       g!   \	        4       '       g   \        4       '       d   ^ RIpW0n        / V n        M�\        4       '       d   ^ RIpW0n        / V n        Mm\        4       '       d   ^ RIpW0n        / V n        MK\        4       '       d   ^ RIpW0n        / V n        M)\        4       '       d   ^ RIpW0n        / V n        MRV n        VP                  4       V n        RV n        / V n        RV n        R# )TNF)Úskip_memory_metricsr   Úpsutilr   r   r   rC   Úgpur   r   r   r   ÚProcessÚprocessÚ	cur_stageÚcpuÚinit_reported)rw   r‚  rƒ  rC   s   &&  r"   rx   ÚTrainerMemoryTracker.__init__q  sà   € Ø#6Ô ä"×$Ò$à'+ˆDÔ$à×#×#Ð#Ùãä"×$Ò$Ô(>×(@Ò(@ÔD[×D]ÒD]ÛàŒJØˆD�HÜ#×%Ò%ÛàŒJØˆD�HÜ#×%Ò%ÛàŒJØˆD�HÜ#×%Ò%ÛàŒJØˆD�HÜ#×%Ò%ÛàŒJØˆD�HàˆDŒJà—~‘~Ó'ˆŒàˆŒØˆŒØ"ˆÖr$   c                ó  € \         P                  ! 4       P                  P                  P                  P                  pWP
                  9   d   V P
                  V,          # \        RV RV P
                  P                  4        24      h)z+derives the stage/caller name automaticallyzwas called from z+, but only expect to be called from one of )ÚinspectÚcurrentframeÚf_backÚf_codeÚco_nameÚstagesr3   Úkeys)rw   Úcallers   & r"   Úderive_stageÚ!TrainerMemoryTracker.derive_stageŸ  sp   € ä×%Ò%Ó'×.Ñ.×5Ñ5×<Ñ<×DÑDˆØ—[‘[Ô Ø—;‘;˜vÕ&Ð&äØ" 6 (Ð*UÐVZ×VaÑVa×VfÑVfÓVhÐUiÐjóð r$   c                óJ   € V P                   P                  4       P                  # )z4get resident set size memory for the current process)r†  Úmemory_infoÚrssr|   s   &r"   Úcpu_mem_usedÚ!TrainerMemoryTracker.cpu_mem_used©  s   € à�|‰|×'Ñ'Ó)×-Ñ-Ð-r$   c                ó�   € RV n          \        V P                  4       V P                   4      V n         V P                  '       d   K>  R# )r  NrÁ   )Úcpu_mem_used_peakr´   r™  Úpeak_monitoringr|   s   &r"   Úpeak_monitor_funcÚ&TrainerMemoryTracker.peak_monitor_func­  s<   € Ø!#ˆÔàÜ%(¨×):Ñ):Ó)<¸d×>TÑ>TÓ%UˆDÔ"ð
 ×'×'Ò'Ùr$   c                óz	  € V P                   '       d   R# V P                  4       pV P                  e   V P                  V8w  d   R# Wn        \        P                  ! 4        V P
                  Ee>   \
        P                  P                  4       '       dK   V P
                  P                  P                  4        V P
                  P                  P                  4        EMÏ\        4       '       dK   V P
                  P                  P                  4        V P
                  P                  P                  4        EMu\        4       '       dK   V P
                  P                  P                  4        V P
                  P                  P                  4        EM\        4       '       dJ   V P
                  P                  P                  4        V P
                  P                  P                  4        MÂ\!        4       '       dJ   V P
                  P"                  P                  4        V P
                  P"                  P                  4        Mi\%        4       '       d&   V P
                  P&                  P                  4        M4\)        4       '       d%   V P
                  P*                  P                  4        V P
                  Ee¬   \
        P                  P                  4       '       d,   V P
                  P                  P-                  4       V n        EM\\        4       '       d,   V P
                  P                  P-                  4       V n        EM!\        4       '       d+   V P
                  P                  P-                  4       V n        Mç\        4       '       d+   V P
                  P                  P-                  4       V n        M­\!        4       '       d+   V P
                  P"                  P-                  4       V n        Ms\%        4       '       d+   V P
                  P&                  P-                  4       V n        M9\)        4       '       d*   V P
                  P*                  P1                  4       V n        V P3                  4       V n        RV n        \8        P:                  ! V P<                  R7      pRVn        VPA                  4        R# )z%start tracking for the caller's stageNT)Útarget)!r‚  r”  r‡  ÚgcÚcollectrC   rb   Úis_availableÚreset_peak_memory_statsÚempty_cacher   rd   r   re   r   rh   r   rf   r   rg   r   ÚmpsÚmemory_allocatedÚgpu_mem_used_at_startÚcurrent_allocated_memoryr™  Úcpu_mem_used_at_startr�  Ú	threadingÚThreadrž  ÚdaemonÚstart)rw   ÚstageÚpeak_monitor_threads   &  r"   r¯  ÚTrainerMemoryTracker.start¹  sÕ  € à×#×#Ð#Ùà×!Ñ!Ó#ˆà�>‰>Ò%¨$¯.©.¸EÔ*AÙàŒä
�
Š
Œà�:‰:Ó!Ü�z‰z×&Ñ&×(Ò(Ø—
‘
—‘×7Ñ7Ô9Ø—
‘
—‘×+Ñ+Ö-Ü'×)Ò)Ø—
‘
—‘×6Ñ6Ô8Ø—
‘
—‘×*Ñ*Ö,Ü(×*Ò*Ø—
‘
—‘×7Ñ7Ô9Ø—
‘
—‘×+Ñ+Ö-Ü'×)Ò)Ø—
‘
—‘×6Ñ6Ô8Ø—
‘
—‘×*Ñ*Õ,Ü'×)Ò)Ø—
‘
—‘×6Ñ6Ô8Ø—
‘
—‘×*Ñ*Õ,Ü'×)Ò)Ø—
‘
—‘×6Ñ6Õ8ô (×)Ò)Ø—
‘
—‘×*Ñ*Ô,ð �:‰:Ó!Ü�z‰z×&Ñ&×(Ò(Ø-1¯Z©Z¯_©_×-MÑ-MÓ-O�Ö*Ü'×)Ò)Ø-1¯Z©Z¯^©^×-LÑ-LÓ-N�Ö*Ü(×*Ò*Ø-1¯Z©Z¯_©_×-MÑ-MÓ-O�Õ*Ü'×)Ò)Ø-1¯Z©Z¯^©^×-LÑ-LÓ-N�Õ*Ü'×)Ò)Ø-1¯Z©Z¯^©^×-LÑ-LÓ-N�Õ*Ü'×)Ò)Ø-1¯Z©Z¯^©^×-LÑ-LÓ-N�Õ*Ü'×)Ò)Ø-1¯Z©Z¯^©^×-TÑ-TÓ-V�Ô*ð &*×%6Ñ%6Ó%8ˆÔ"à#ˆÔÜ'×.Ò.°d×6LÑ6LÔMÐØ%)ÐÔ"Ø×!Ñ!Ö#r$   c                ó”  € V P                   e   V P                   V8w  d   R# RV n        \        P                  ! 4        V P                  Eed   \        P
                  P                  4       '       d'   V P                  P
                  P                  4        EM\        4       '       d&   V P                  P                  P                  4        Mä\        4       '       d&   V P                  P                  P                  4        M¯\        4       '       d&   V P                  P                  P                  4        Mz\        4       '       d&   V P                  P                  P                  4        ME\!        4       '       d   M4\#        4       '       d%   V P                  P$                  P                  4        V P                  Eey   \        P
                  P                  4       '       dU   V P                  P
                  P'                  4       V n        V P                  P
                  P+                  4       V n        EM>\        4       '       dU   V P                  P                  P'                  4       V n        V P                  P                  P+                  4       V n        EMÚ\        4       '       dU   V P                  P                  P'                  4       V n        V P                  P                  P+                  4       V n        EMv\        4       '       dU   V P                  P                  P'                  4       V n        V P                  P                  P+                  4       V n        EM\        4       '       dT   V P                  P                  P'                  4       V n        V P                  P                  P+                  4       V n        M¯\!        4       '       dT   V P                  P.                  P'                  4       V n        V P                  P.                  P+                  4       V n        ML\#        4       '       d2   V P                  P$                  P1                  4       V n        RV n        M\3        R4      hRV P4                  RV P(                  RV P(                  V P4                  ,
          /V P6                  V P                   &   V P,                  eG   \9        ^ V P,                  V P(                  ,
          4      V P6                  V P                   ,          R&   M RV P6                  V P                   ,          R&   V P;                  4       V n        RV P>                  RV P<                  RV P<                  V P>                  ,
          R\9        ^ V P@                  V P<                  ,
          4      /V PB                  V P                   &   RV n         R# )	z"stop tracking for the passed stageNFzNo available GPU device found!Úbeginrì   ÚallocÚpeakedzNot available)"r‡  r�  r¢  r£  rC   rb   r¤  r¦  r   rd   r   re   r   rh   r   rf   r   r   r§  r¨  Úgpu_mem_used_nowÚmax_memory_allocatedÚgpu_mem_used_peakrg   rª  r3   r©  r„  r´   r™  Úcpu_mem_used_nowr«  rœ  rˆ  )rw   r°  s   &&r"   ÚstopÚTrainerMemoryTracker.stop÷  sÁ  € ð �>‰>Ò%¨$¯.©.¸EÔ*AÙð  %ˆÔô 	�
Š
Œà�:‰:Ó!Ü�z‰z×&Ñ&×(Ò(Ø—
‘
—‘×+Ñ+Ö-Ü'×)Ò)Ø—
‘
—‘×*Ñ*Õ,Ü(×*Ò*Ø—
‘
—‘×+Ñ+Õ-Ü'×)Ò)Ø—
‘
—‘×*Ñ*Õ,Ü'×)Ò)Ø—
‘
—‘×*Ñ*Õ,Ü'×)Ò)ð Ü'×)Ò)Ø—
‘
—‘×*Ñ*Ô,ð �:‰:Ó!Ü�z‰z×&Ñ&×(Ò(Ø(,¯
©
¯©×(HÑ(HÓ(J�Ô%Ø)-¯©¯©×)MÑ)MÓ)O�Ö&Ü'×)Ò)Ø(,¯
©
¯©×(GÑ(GÓ(I�Ô%Ø)-¯©¯©×)LÑ)LÓ)N�Ö&Ü(×*Ò*Ø(,¯
©
¯©×(HÑ(HÓ(J�Ô%Ø)-¯©¯©×)MÑ)MÓ)O�Ö&Ü'×)Ò)Ø(,¯
©
¯©×(GÑ(GÓ(I�Ô%Ø)-¯©¯©×)LÑ)LÓ)N�Ö&Ü'×)Ò)Ø(,¯
©
¯©×(GÑ(GÓ(I�Ô%Ø)-¯©¯©×)LÑ)LÓ)N�Õ&Ü'×)Ò)Ø(,¯
©
¯©×(GÑ(GÓ(I�Ô%Ø)-¯©¯©×)LÑ)LÓ)N�Õ&Ü'×)Ò)Ø(,¯
©
¯©×(OÑ(OÓ(Q�Ô%à)-�Õ&ô !Ð!AÓBÐBð ˜×3Ñ3Ø�t×,Ñ,Ø˜$×/Ñ/°$×2LÑ2LÕLð(ˆD�H‰H�T—^‘^Ñ$ð
 ×%Ñ%Ò1Ü58¸¸D×<RÑ<RÐUY×UjÑUjÕ<jÓ5k�—‘˜Ÿ™Õ(¨Ò2à5D�—‘˜Ÿ™Õ(¨Ñ2ð !%× 1Ñ 1Ó 3ˆÔà�T×/Ñ/Ø�4×(Ñ(Ø�d×+Ñ+¨d×.HÑ.HÕHØ”c˜!˜T×3Ñ3°d×6KÑ6KÕKÓLð	$
ˆ�‰�—‘Ñ ð ˆŽr$   c                óð  € V P                   '       d   R# V P                  e   V P                  V8w  d   R# V.pV P                  '       g   VP                  ^ R4       RV n        V F²  pR
 F©  pWP                  9   d:   W@P                  V,          9   d#   V P                  V,          V,          W! RV R2&   V P
                  f   K\  WP                  9   g   Kn  W@P                  V,          9   g   K‡  V P                  V,          V,          W! RV R2&   K«  	  K´  	  V^ ,          R8X  dM   V P                  R,          R,          VR&   V P
                  e    V P                  R,          R,          VR	&   R# R# R# )zupdates the metricsNry  TÚ	_mem_cpu_Ú_deltaÚ	_mem_gpu_r´  Úbefore_init_mem_cpuÚbefore_init_mem_gpu)rµ  r¶  )r‚  r‡  r‰  Úinsertrˆ  rC   r„  )rw   r°  r‘   r‘  Úts   &&&  r"   Úupdate_metricsÚ#TrainerMemoryTracker.update_metricsM  s:  € à×#×#Ð#Ùð �>‰>Ò%¨$¯.©.¸EÔ*AÙð �ˆØ×!×!Ð!Ø�M‰M˜!˜VÔ$Ø!%ˆDÔãˆEÛ(�ØŸH™HÔ$¨¯h©h°u­oÔ)=Ø<@¿H¹HÀU½OÈAÕ<N�G˜g Y¨q¨c°Ð8Ñ9Ø—:‘:Ô)¨e·x±xÖ.?ÀAÏÉÐRWÍÖDXØ<@¿H¹HÀU½OÈAÕ<N�G˜g Y¨q¨c°Ð8Ó9ó	 )ñ ð �!�9˜ÔØ-1¯X©X°fÕ-=¸gÕ-FˆGÐ)Ñ*Ø�z‰zÒ%Ø15·±¸&Õ1AÀ'Õ1J�Ð-Ó.ñ &ñ r$   Nc                óž   € V P                   '       d   R# V P                  4       pV P                  V4       Ve   V P                  W!4       R# R# )z<combine stop and metrics update in one call for simpler codeN)r‚  r”  r»  rÅ  )rw   r‘   r°  s   && r"   Ústop_and_update_metricsÚ,TrainerMemoryTracker.stop_and_update_metricsv  sF   € à×#×#Ð#Ùà×!Ñ!Ó#ˆØ�	‰	�%Ôð ÒØ×Ñ Ö/ñ r$   )rˆ  r«  rº  rœ  r‡  r„  r©  r·  r¹  r‰  r�  r†  r‚  rC   r   ru   )r†   r‡   rˆ   r‰   rŠ   r‘  rx   r”  r™  rž  r¯  r»  rÅ  rÈ  r‹   rŒ   r�   s   @r"   rx  rx  R  sd   ø‡ € ñð, 	�FØ�Ø Ø˜gØ�FØ�6ð€Fô,#ò\ò.ò
ò<$ò|Tòl!K÷R
0ò 
0r$   rx  c                óF   € V ^8„  d   QhR\         R\        \        ,          /# )r;   Údatasetr¾   )r   r   r   )r@   s   "r"   rA   rA   ƒ  s   € ÷ ñ œð ¤	¬%Õ 0ñ r$   c                ó\   €  \        V 4      RJ#   \         d     R# \         d     R# i ; i)zJ
Checks if the dataset implements __len__() and it doesn't raise an error
NF)r�   Ú	TypeErrorr)   )rË  s   &r"   Ú
has_lengthrÎ  ƒ  s3   € ðÜ�7‹| 4Ð'Ð'øÜô âÜô âðús   ‚ �+�+¦+ª+c           
     ó*  € \        V \        \        34      '       d   \        V 4      ! R V  4       4      # \        V \        4      '       d>   \        V 4      ! V P                  4        UUu/ uF  w  rV\        V4      bK  	  upp4      # \        V \        P                  4      '       d   V P                  4       # \        4       '       dF   \        V \        P                  4      '       d&   V P                  4       ^8X  d   V P                  4       # V # u uppi )zE
Recursively calls `.item()` on the element of the dictionary passed
c              3   ó8   "  € T F  p\        V4      x € K  	  R # 5iru   )Údenumpify_detensorize)Ú.0r  s   & r"   Ú	<genexpr>Ú(denumpify_detensorize.<locals>.<genexpr>–  s   é € ÐG¹w¸!Ô2°1×5Ð5»wùs   ‚)r   r¿   rq   Útyper“   ÚitemsrÑ  r`   ÚgenericÚitemr   rC   ÚTensorÚnumel)r‘   ÚkÚvs   &  r"   rÑ  rÑ  ‘  sÃ   € ô �'œD¤%˜=×)Ò)Ü�GŒ}ÑG¹wÓGÓGÐGÜ	�GœT×	"Ò	"Ü�GŒ}ÀgÇmÁmÄoÔVÁo¹d¸a˜aÔ!6°qÓ!9Ò9ÁoÒVÓWÐWÜ	�GœRŸZ™Z×	(Ò	(Ø�|‰|‹~ÐÜ	×	Ò	¤*¨W´e·l±l×"CÒ"CÈÏÉËÐ[\ÔH\Ø�|‰|‹~ÐØ€Nùó Ws   Á)D
c                óf  € \        V \        P                  4      '       dj   \        \        P
                  ! V P                  4      P                  4      pV\        V P                  4      ,
          \        V P                  4      ,
          # \        \        P
                  ! V 4      P                  4      # )zY
Return the number of arguments of the passed function, even if it's a partial function.
)
r   Ú	functoolsr   r�   rŒ  Ú	signatureÚfuncr7  ÚargsÚkeywords)rà  Ú
total_argss   & r"   Únumber_of_argumentsrä     ss   € ô �$œ	×)Ñ)×*Ò*Üœ×*Ò*¨4¯9©9Ó5×@Ñ@ÓAˆ
ØœC §	¡	›NÕ*¬S°·±Ó-?Õ?Ð?ÜŒw× Ò  Ó&×1Ñ1Ó2Ð2r$   c                óJ   € V ^8„  d   QhR\         R,          R\        R\        /# )r;   ÚfunctionNÚstarting_batch_sizeÚauto_find_batch_size)r   r?   rM   )r@   s   "r"   rA   rA   ª  s-   € ÷ Gñ GÜ˜�oðGÜ;>ðGÜ\`ñGr$   c                óÀ   € V f   \         P                  ! \        VVR7      # V'       d    \        \        R4       ^ RIHp V! WR7      # \         P                  ! WR7      # )aÿ  
Args:
A basic decorator that will try to execute `function`. If it fails from exceptions related to out-of-memory or
CUDNN, the batch size is multiplied by 0.9 and passed to `function`. `function` must take in a `batch_size` parameter as
its first argument.
    function (`Callable`, *optional*)
        A function to wrap
    starting_batch_size (`int`, *optional*)
        The batch size to try and fit into memory
    auto_find_batch_size (`bool`, *optional*)
        If False, will just execute `function`
)rç  rè  Ú
accelerate)Úfind_executable_batch_size)ræ  rç  )Ú
batch_size)rÞ  r   rë  r   Úaccelerate.utils)ræ  rç  rè  Ú%accelerate_find_executable_batch_sizes   &&& r"   rë  rë  ª  sU   € ð ÒÜ× Ò Ü&Ø 3Ø!5ô
ð 	
÷ ÜÔ4°lÔCÝhá4¸hÔpÐpä×Ò˜XÔFÐFr$   c                   ó2   € ] tR tRtRtRtRtRtRtRt	Rt
R	tR
# )Ú
FSDPOptioniÉ  Ú
full_shardÚshard_grad_opÚno_shardÚhybrid_shardÚhybrid_shard_zero2ÚoffloadÚ	auto_wrapr—   N)r†   r‡   rˆ   r‰   Ú
FULL_SHARDÚSHARD_GRAD_OPÚNO_SHARDÚHYBRID_SHARDÚHYBRID_SHARD_ZERO2ÚOFFLOADÚ	AUTO_WRAPr‹   r—   r$   r"   rð  rð  É  s&   † Ø€JØ#€MØ€HØ!€LØ-ÐØ€GØ„Ir$   rð  c                   ó^   a € ] tR tRt o RtRV 3R lR lltV 3R lR ltV 3R lR	 ltR
tV t	R# )ÚRemoveColumnsCollatoriÓ  zWWrap the data collator to remove unused columns before they are passed to the collator.Nc                óB   <€ V ^8„  d   QhRS[ R,          RS[ R,          /# )r;   Ú
model_nameNÚdescription)r”   )r@   rr   s   "€r"   rA   Ú"RemoveColumnsCollator.__annotate__Ö  s)   ø€ ÷ $ñ $ñ
 ˜$•Jð$ñ ˜4•Zñ$r$   c                óP   € Wn         W n        W0n        WPn        W@n        R V n        R# )FN)Údata_collatorÚsignature_columnsrÈ   r  r  Úmessage_logged)rw   r  r  rÈ   r  r  s   &&&&&&r"   rx   ÚRemoveColumnsCollator.__init__Ö  s(   € ð +ÔØ!2ÔØŒØ&ÔØ$ŒØ#ˆÖr$   c                ó&   <€ V ^8„  d   QhRS[ RS[ /# )r;   Úfeaturer¾   )r“   )r@   rr   s   "€r"   rA   r  å  s   ø€ ÷ Qñ Q¡tð Q±ñ Qr$   c                ó¶  € \        V\        4      '       g   V# V P                  '       gõ   V P                  '       dã   V P                  '       dÑ   \        \        VP                  4       4      \        V P                  4      ,
          4      p\        V4      ^ 8”  d…   V P                  f   RMRV P                   R2pV P                  P                  RV RV P                   RRP                  V4       RRP                  V4       R	V P                   R
24       RV n        VP                  4        UUu/ uF  w  rEW@P                  9   g   K  WEbK  	  upp# u uppi )r€   Ú zin the z setzThe following columns z) don't have a corresponding argument in `z!.forward` and have been ignored: z, z. If z are not expected by `z/.forward`,  you can safely ignore this message.T)r   r“   r  rÈ   r  r¿   Úsetr’  r  r�   r  Úinfor³   rÖ  )rw   r  Úignored_columnsÚdset_descriptionrÛ  rÜ  s   &&    r"   Ú_remove_columnsÚ%RemoveColumnsCollator._remove_columnså  s(  € Ü˜'¤4×(Ò(ØˆNØ×"×"Ð" t§{§{ {°t··°Ü"¤3 w§|¡|£~Ó#6¼¸T×=SÑ=SÓ9TÕ#TÓUˆOÜ�?Ó# aÔ'Ø)-×)9Ñ)9Ò)A¡2ÈÐQU×QaÑQaÐPbÐbfÐGgÐ Ø—‘× Ñ Ø,Ð-=Ð,>ð ?ØŸ™Ð(Ð(IÈ$Ï)É)ÐTcÓJdÐIeð fØŸ9™9 _Ó5Ð6Ð6LÈTÏ_É_ÐL]ð ^;ð;ôð '+�Ô#Ø!(§¡¤ÔP¡™˜°A×9OÑ9OÑ4O”�’¡ÒPÐPùÓPs   Ä2EÅEc                ó0   <€ V ^8„  d   QhRS[ S[,          /# )r;   Úfeatures)r¿   r“   )r@   rr   s   "€r"   rA   r  õ  s   ø€ ÷ ,ñ ,¡¡d¥ñ ,r$   c                ól   € V Uu. uF  q P                  V4      NK  	  ppV P                  V4      # u upi ru   )r  r  )rw   r  r  s   && r"   Ú__call__ÚRemoveColumnsCollator.__call__õ  s6   € ÙAIÓJÁ°g×(Ñ(¨Ö1ÁˆÐJØ×!Ñ! (Ó+Ð+ùò Ks   …1)r  r  rÈ   r  r  r  ©NNN)
r†   r‡   rˆ   r‰   rŠ   rx   r  r  r‹   rŒ   r�   s   @r"   r   r   Ó  s(   ø‡ € Ùa÷$ò $÷Qð Q÷ ,ö ,r$   r   c                ó0   € V ^8„  d   QhR\         R\        /# )r;   r¯   Úreturn_is_regex)r”   rM   )r@   s   "r"   rA   rA   ú  s   € ÷ $ñ $¼#ð $ÔPTñ $r$   c                óÀ  a€ RpRp\        V \        4      '       d'   \        \        P                  ! V S4      4      pV S8g  pM‘SV 9   d   RpM‡\
        ;QJ d    V3R lV  4       F  '       g   K   RM	  RM! V3R lV  4       4      '       d   RpMD\
        ;QJ d    V3R lV  4       F  '       g   K   RM	  RM! V3R lV  4       4      '       d   RpRpV'       d   W43# V# )a  A helper method to check if the passed module's key name matches any of the target modules in the optim_target_modules.

Args:
    optim_target_modules (`Union[str, list[str]]`):
        A list of strings to try to match. Can be also a full string.
    key (`str`):
        A key to search any matches in optim_target_modules
    return_is_regex (`bool`):
        If set to `True`, the method will return whether the passed `optim_target_modules`
        is a regex or not.

Returns:
    `bool` : True of match object if key matches any target modules from config, False or
    None if no match found
    `bool` : If the matched target module is a regex to silence out the warnings in Trainer
    for extra modules being found (only if `target_module_found=True` for an array of regex).
FTc              3   ó,   <"  € T F	  qS9   x € K  	  R # 5iru   r—   )rÒ  Ú
target_keyr¯   s   & €r"   rÓ  Ú-check_target_module_exists.<locals>.<genexpr>  s   øé € ÐFÑ1E :˜3ÖÓ1Eùs   ƒc              3   ód   <"  € T F%  p\        \        P                  ! VS4      4      x € K'  	  R # 5iru   )rM   rÅ   Ú	fullmatch)rÒ  Úoptim_target_moduler¯   s   & €r"   rÓ  r    s(   øé € ÐjÑUiÐ>QŒT”"—,’,Ð2°CÓ8×9Ð9ÓUiùs   ƒ-0)r   r”   rM   rÅ   r!  Úany)Úoptim_target_modulesr¯   r  Útarget_module_foundÚis_regexs   &f&  r"   Úcheck_target_module_existsr'  ú  s·   ø€ ð$  ÐØ€HäÐ&¬×,Ò,Ü"¤2§<¢<Ð0DÀcÓ#JÓKÐØ'¨3Ñ.‰Ø	Ð$Ô	$à"Ñß	‹ÔFÑ1EÓF��ŠÔFÑ1EÓF×	FÒ	FØ"Ñß	‹ÔjÑUiÓj��ŠÔjÑUiÓj×	jÒ	jØ"ÐØˆçØ"Ð,Ð,àÐr$   c                óÖ  € \         P                  P                  V\        4      p\         P                  P                  V\        4      p\         P                  P                  V4      p\         P                  P                  V4      pV'       g6   V'       g.   \        \        3p\        RRP                  V4       RV R24      hT;'       d    T;'       g    V'       * p	V	'       d   TMTp
\        V
RRR7      ;_uu_ 4       p\        P                  ! V4      pRRR4       \        \        XR	,          P                  4       4      4      pVR	,          P                  4       pV P                  4       P                  4       pV Uu. uF  pVV9  g   K  VNK  	  ppV Uu. uF  pVV9  g   K  VNK  	  ppV'       dÉ   \        V4      ^ 8”  g   \        V4      ^ 8”  d©   R
V P                   P"                   2p\        V4      ^ 8”  d3   RP                  V Uu. uF	  pRV R2NK  	  up4      pVRV R2,          p\        V4      ^ 8”  d3   RP                  V Uu. uF	  pRV R2NK  	  up4      pVRV R2,          p\%        V4      hV	'       d   \&        pM&\)        4        \+        \,        P                  RRR7      pV FR  pV! \         P                  P                  VV4      4      pV P/                  VRR7       ?\0        P2                  ! 4        KT  	  \,        P4                  P6                  P8                  P;                  VV4      #   + '       g   i     EL4; iu upi u upi u upi u upi )a¡  
This is the same as
[`torch.nn.Module.load_state_dict`](https://pytorch.org/docs/stable/generated/torch.nn.Module.html?highlight=load_state_dict#torch.nn.Module.load_state_dict)
but for a sharded checkpoint.

This load is performed efficiently: each checkpoint shard is loaded one by one in RAM and deleted after being
loaded in the model.

Args:
    model (`torch.nn.Module`): The model in which to load the checkpoint.
    folder (`str` or `os.PathLike`): A path to a folder containing the sharded checkpoint.
    strict (`bool`, *optional*, defaults to `True`):
        Whether to strictly enforce that the keys in the model state dict match the keys in the sharded checkpoint.
    prefer_safe (`bool`, *optional*, defaults to `True`):
        If both safetensors and PyTorch save files are present in checkpoint and `prefer_safe` is True, the
        safetensors files will be loaded. Otherwise, PyTorch files are always loaded when possible.

Returns:
    `NamedTuple`: A named tuple with `missing_keys` and `unexpected_keys` fields
        - `missing_keys` is a list of str containing the missing keys
        - `unexpected_keys` is a list of str containing the unexpected keys
zCan't find a checkpoint index (z or z) in Ú.Úrzutf-8)ÚencodingNÚ
weight_mapz#Error(s) in loading state_dict for Ú,Ú"z
Missing key(s): z
Unexpected key(s): rˆ  T)Úmap_locationÚweights_onlyF)Ústrict)rU   r±   r³   r
   r	   Úisfiler3   ÚopenÚjsonÚloadr¿   r  r  r’  Ú
state_dictr�   Ú	__class__r†   ÚRuntimeErrorÚsafe_load_filer   r   rC   Úload_state_dictr¢  r£  ÚnnÚmodulesÚmoduleÚ_IncompatibleKeys)r!   rµ   r1  Úprefer_safeÚ
index_fileÚsafe_index_fileÚindex_presentÚsafe_index_presentÚ	filenamesÚ	load_safeÚ
load_indexÚfÚindexÚshard_filesÚloaded_keysÚ
model_keysr¯   Úmissing_keysÚunexpected_keysÚerror_messagerÛ  Ústr_missing_keysÚstr_unexpected_keysÚloaderÚ
shard_filer6  s   &&&&                      r"   Úload_sharded_checkpointrS  !  sÏ  € ô0 —‘—‘˜fÔ&8Ó9€JÜ—g‘g—l‘l 6Ô+BÓC€Oä—G‘G—N‘N :Ó.€MÜŸ™Ÿ™¨Ó8Ðç×!3Ü'Ô)@ÐAˆ	ÜÐ:¸6¿;¹;ÀyÓ;QÐ:RÐRWÐX^ÐW_Ð_`ÐaÓbÐbà"×IÐI¨×(HÐ(H¸=Ô7H€Iß$-‘°:€Jä	ˆj˜#¨×	0Õ	0°AÜ—	’	˜!“ˆ÷ 
1ô ”s˜5 Õ.×5Ñ5Ó7Ó8Ó9€Kð ˜Õ%×*Ñ*Ó,€KØ×!Ñ!Ó#×(Ñ(Ó*€JÙ#-ÓH¡:˜C°¸KÑ1G—C�C¡:€LÐHÙ&1ÓK¡k˜s°SÀ
Ñ5J—s�s¡k€OÐKß”3�|Ó$ qÔ(¬C°Ó,@À1Ô,DØ=¸e¿o¹o×>VÑ>VÐ=WÐXˆÜˆ|Ó˜qÔ Ø"Ÿx™x¹<Ó(H¹<°a¨1¨Q¨C¨q«¹<Ñ(HÓIÐØÐ1Ð2BÐ1CÀ1ÐEÕEˆMÜˆÓ !Ô#Ø"%§(¡(¹oÓ+N¹o¸¨a°¨s°!«H¹oÑ+NÓ"OÐØÐ4Ð5HÐ4IÈÐKÕKˆMÜ˜=Ó)Ð)çÜ‰ä Ô"ÜœŸ™°%ÀdÔKˆã!ˆ
ÙœBŸG™GŸL™L¨°Ó<Ó=ˆ
Ø×Ñ˜j°ÐÔ7ð Ü
�
Š
Žñ "ô �8‰8×Ñ×"Ñ"×4Ñ4°\À?ÓSÐS÷I 
1×	0Ð	0üò IùÚKùò )Iùò ,Os0   ÄMÆ	MÆMÆ	MÆ*MÈM!ÉM&ÍM	c           	     ó¦  € RRRRRR/pRpRpVP                  4        FF  w  rV\        WR4      p\        WR4      pVf   K#  Vf   K)  Wx8w  g   K1  VRV RV R	V R
2,          pRpKH  	  V P                  p	VP                  \	        ^V P
                  4      ,          p
Wš8w  d   VRV	 R	V
 R
2,          pRpV'       d   \        P                  V4       R# R# )a=  
Compare training arguments with those stored in a checkpoint's trainer state.

Logs a warning if there are mismatches between the current training arguments
and the ones saved in the checkpoint.

Args:
    training_args: The current training arguments.
    trainer_state: The trainer state loaded from a checkpoint.
Úlogging_stepsÚ
eval_stepsÚ
save_stepsFztWarning: The following arguments do not match the ones in the `trainer_state.json` within the checkpoint directory: Nz
	z: z (from args) != z (from trainer_state.json)Tz
	per_device_train_batch_size: )rÖ  r1   r  Útrain_batch_sizer´   Ún_gpurÈ   rÉ   )Útraining_argsÚtrainer_stateÚattributes_mapÚhas_warningÚwarning_strÚarg_attrÚ
state_attrÚ	arg_valueÚstate_valueÚtrain_bs_argsÚtrain_bs_states   &&         r"   Ú#compare_trainer_and_checkpoint_argsre  m  s   € ð 	˜Ø�lØ�lð€Nð €Kð I€KØ .× 4Ñ 4Ö 6ÑˆÜ˜M°TÓ:ˆ	Ü˜m¸Ó>ˆàÔ  [Ô%<ÀÖAYØ˜T ( ¨2¨i¨[Ð8HÈÈÐUoÐpÕpˆKØŠKñ !7ð "×=Ñ=€MØ"×3Ñ3´s¸1¸m×>QÑ>QÓ7RÕR€NàÔ&ØÐ:¸=¸/ÐIYÐZhÐYið  jDð  Eõ  	EˆØˆçÜ×Ñ˜KÖ(ñ r$   c                óÒ  € ^RI Hp ^RIHp \	        W4      '       d   VP
                  pMTp\        V R4      ;'       d    V P                  RJp/ pVP                  \        V P                  RR4      8g  pV'       d¼   V P                  P                  f+   WtP                  V P                  P                  8g  ,          pMy\	        V P                  P                  \        4      '       d'   V P                  P                  .V P                  n        WtP                  V P                  P                  9  ,          pV'       d¤   VP                  VR&   VP                  V P                  n        V'       dr   VP                  .pV P                  P                  e'   V\        V P                  P                  4      ,          pV U	u. uF
  q™f   K  V	NK  	  up	V P                  n        VP                  \        V P                  RR4      8g  p
V'       d*   W¤P                  V P                  P                  8g  ,          p
V
'       dN   VP                  VR&   VP                  V P                  n        V'       d   VP                  V P                  n        VP                  \        V P                  RR4      8g  pV'       d*   W´P                  V P                  P                  8g  ,          pV'       dN   VP                  VR&   VP                  V P                  n        V'       d   VP                  V P                  n        \        V4      ^ 8”  d   \         P#                  RV R	24       R# R# u up	i )
a¦  
Aligns the special tokens of the tokenizer with the model configs.

A new tokens may be defined in the tokenizer for fine-tuning purposes, e.g. an "end of turn" token may be
added on chat models. In that case, we want the model configs to be aligned with the tokenizer, so that all
downstream uses work as expected. This alignment should happen before training, to ensure the prediction step
uses the new tokens as well.
)ÚProcessorMixin)ÚPreTrainedTokenizerBaseÚgeneration_configNÚeos_token_idÚbos_token_idÚpad_token_idzÞThe tokenizer has new PAD/BOS/EOS tokens that differ from the model config and generation config. The model config and generation config were aligned accordingly, being updated with the tokenizer's values. Updated tokens: r)  )Úprocessing_utilsrg  Útokenization_utils_baserh  r   Ú	tokenizerr(   ri  rj  r1   Úconfigr?   r¿   rk  rl  r�   rÈ   Úwarning)r!   Úprocessing_classrg  rh  ro  Úmodel_has_generation_configÚupdated_tokensÚtokenizer_has_new_eosÚall_eos_tokensÚtokenÚtokenizer_has_new_bosÚtokenizer_has_new_pads   &&          r"   Úalign_special_tokensrz  ”  s·  € õ 1Ý@äÐ"×3Ò3Ø-=×-GÑ-G‰	à$ˆ	Ü")¨%Ð1DÓ"E×"mÐ"mÈ%×JaÑJaÐimÐJmÐØ€Nð &×2Ñ2´g¸e¿l¹lÈNÐ\`Ó6aÑaÐß"à×"Ñ"×/Ñ/Ò7Ø!×%;Ñ%;¸u×?VÑ?V×?cÑ?cÑ%cÕcÑ!ô ˜%×1Ñ1×>Ñ>Ä×DÒDØ8=×8OÑ8O×8\Ñ8\Ð7]�×'Ñ'Ô4à!×%;Ñ%;À5×CZÑCZ×CgÑCgÑ%gÕgÐ!çØ)2×)?Ñ)?ˆ�~Ñ&Ø$-×$:Ñ$:ˆ�‰Ô!÷ 'Ø'×4Ñ4Ð5ˆNØ×&Ñ&×3Ñ3Ò?Ø¤$ u×'>Ñ'>×'KÑ'KÓ"LÕL�ÙGUÓ3kÁ~¸e·E°EÁ~Ñ3kˆE×#Ñ#Ô0ð &×2Ñ2´g¸e¿l¹lÈNÐ\`Ó6aÑaÐß"Ø×!7Ñ!7¸5×;RÑ;R×;_Ñ;_Ñ!_Õ_ÐçØ)2×)?Ñ)?ˆ�~Ñ&Ø$-×$:Ñ$:ˆ�‰Ô!ß&Ø3<×3IÑ3IˆE×#Ñ#Ô0ð &×2Ñ2´g¸e¿l¹lÈNÐ\`Ó6aÑaÐß"Ø×!7Ñ!7¸5×;RÑ;R×;_Ñ;_Ñ!_Õ_ÐçØ)2×)?Ñ)?ˆ�~Ñ&Ø$-×$:Ñ$:ˆ�‰Ô!ß&Ø3<×3IÑ3IˆE×#Ñ#Ô0ô ˆ>Ó˜QÔÜ�‰ð'à'5Ð&6°að9ö	
ñ ùò3 4ls   ÇM$ÇM$c               #  óŽ   "  € ^ RI Hp  V P                  4         Rx € V P                  4        R#   T P                  4        i ; i5i)z>Context manager that suppresses huggingface_hub progress bars.N)Úhuggingface_hub.utilsÚutilsÚdisable_progress_barsÚenable_progress_bars)Úhf_hub_utilss    r"   Úsuppress_progress_barsr�  ß  s6   é € õ 1à×&Ñ&Ô(ð,Ûà×)Ñ)Ö+øˆ×)Ñ)Õ+üs   ‚Aš0 žA°AÁAr   r  )Né€   F)TT)_rŠ   Ú
contextlibr  rÞ  r¢  rŒ  r4  rU   r_   rÅ   rØ   r¬  rS  Úcollections.abcr   r   r   Úpathlibr   Útypingr   r   r   Únumpyr`   r}  r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   Ú
get_loggerr†   rÈ   rC   Úsafetensors.torchr   r9  Úpeftr   r   r#   r*   r9   rH   r\   rE   rj   r�   rœ   r    ÚPREFIX_CHECKPOINT_DIRÚcompiler©   r¸   rÊ   rÝ   rß   rç   rë   rô   r  r#  r.  r;  r=  rI  rN  r	  r^  rx  rÎ  rÑ  rä  rë  rð  r   r'  rS  re  rz  Úcontextmanagerr�  r—   r$   r"   Ú<module>rŽ     s	  ðñó Û Û Û 	Û Û Û 	Û Û 	Û Û Û ß +Ý Ý ß -Ñ -ã ÷÷ ÷ ÷ õ ð* 
×	Ò	˜HÓ	%€ñ ×ÒÛÝ=á×ÒÑ-×/Ò/ß.òòYò6(
õV÷/÷4(÷<""ñ ""ôJ�Zô ô%�zô %ô�*ô ð %Ð Ø—’˜DÐ#8Õ8¸;ÕFÓG€ò	kð 3ØØ(,÷	9ð| $(Ø(,ØØ2÷,ô^�|ô ô�<ô ô(�,ô (ô#ˆjô #õ,@õ*
õõô$�lô ò	!òôô<�Lô ÷Bn0ñ n0õb	òò3÷Gô>�ô ÷$,ñ $,÷N$ôNITòX$)òNH
ðV ×Ññ,ó ò,r$   