+
    œ°³j.  ã                   ó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 ]P                  ! R4      tR R ltR,R	 R
 lltR R lt]P                  ! R4      tR R ltR tR tRRRRRRRRRRRRRRR R!R"R#/	tR$ tR-R% ltR& R' lt] ! R( R)4      4       tR.R* R+ lltR# )/é    N)ÚOrderedDictÚdefaultdict)Ú	dataclass)ÚAny)ÚPipelineStagez(?<=\.)(\d+)(?=\.|$)c                ó0   € V ^8„  d   QhR\         R\         /# )é   ÚkeyÚreturn©Ústr)Úformats   "Úb/home/luca/screen-checking/.venv/lib/python3.14/site-packages/transformers/utils/loading_report.pyÚ__annotate__r      s   € ÷ #ñ #”Sð #œSñ #ó    c                ó.   € \         P                  RV 4      # )zBReplace every dot-delimited integer with '*' to get the structure.Ú*)Ú	_DIGIT_RXÚsub)r
   s   &r   Ú_pattern_ofr      s   € ä�=‰=˜˜cÓ"Ð"r   c                óF   € V ^8„  d   QhR\         \        ,          R\        /# )r	   Úvaluesr   )ÚlistÚintr   )r   s   "r   r   r   !   s   € ÷ 'ñ 'œœc�ð '´#ñ 'r   c                óä   € \        V 4      ^8X  d   \        V ^ ,          4      # \        V 4      p \        V 4      V8”  d   V ^ ,           RV R,           2# RP                  \	        \        V 4      4      # )zEFormat a list of ints as single number, {a, ..., b}, or first...last.z...z, éÿÿÿÿ)Úlenr   ÚsortedÚjoinÚmap)r   Úcutoffs   &&r   Ú_fmt_indicesr"   !   s`   € ä
ˆ6ƒ{�aÔÜ�6˜!•9‹~ÐÜ�F‹^€FÜ
ˆ6ƒ{�VÔØ˜•)�˜C  r¥
˜|Ð,Ð,Ø�9‰9”Sœ˜fÓ%Ó&Ð&r   c                ót   € V ^8„  d   QhR\         \        \        3,          R\         \        \        3,          /# )r	   Úmappingr   )Údictr   r   )r   s   "r   r   r   +   s*   € ÷ *ñ *œT¤#¤s (�^ð *´´S¼#°Xµñ *r   c           	     óT  € Rp\        V \        4      '       g   V  Uu/ uF  q"VbK  	  p pRp\        \        4      pV P	                  4        F¬  w  rE\
        P                  V4      p\        V4      p\        V4       Fa  w  r‰\        W7,          4      V8:  d    W7,          P                  \        4       4       W7,          V,          P                  \        V	4      4       Kc  	  W7,          P                  V4       K®  	  / p
VP	                  4        Fï  w  r{VRR VR,          r\VP                  R4      pV^ ,          p\        ^\        V4      4       F¦  pV^,
          \        V4      8  du   WÈ^,
          ,          '       d`   \!        \#        WÈ^,
          ,          4      4      p\        WÈ^,
          ,          4      ^8”  d   VRV,           R,           ,          pMWï,          pM	VR,          pWíV,          ,          pK¨  	  WZV&   Kñ  	  \%        V
4      pV'       d   VP'                  4       # V# u upi )z¨
Merge keys like 'layers.0.x', 'layers.1.x' into 'layers.{0, 1}.x'
BUT only merge together keys that have the exact same value.
Returns a new dict {merged_key: value}.
FTNr   Ú{Ú}r   )Ú
isinstancer%   r   r   Úitemsr   Úfindallr   Ú	enumerater   ÚappendÚsetÚaddr   ÚsplitÚranger"   r   r   Úkeys)r$   Únot_mappingÚkÚbucketr
   ÚvalÚdigsÚpattÚiÚdÚ	out_itemsr   ÚsetsÚpartsÚfinalÚinsertÚouts   &                r   Úupdate_key_namerA   +   s¸  € ð €KÜ�gœt×$Ò$Ù!(Ó)¡˜A�a’4¡ˆÐ)Øˆä.9¼$Ó.?€FØ—M‘M–O‰ˆÜ× Ñ  Ó%ˆÜ˜3ÓˆÜ˜d–O‰DˆAÜ�6•<Ó  AÔ%Ø•×#Ñ#¤C£EÔ*Ø�L˜�O×Ñ¤ A£Ö'ñ $ð 	�×Ñ˜CÖ ñ $ð €IØŸ™ž‰ˆØ˜3˜B�K ¨¥ˆcØ—
‘
˜3“ˆØ�a•ˆÜ�qœ#˜e›*Ö%ˆAØ�1�u”s˜4“yÔ  T¨a­%§[¤[Ü%¤f¨T°aµ%­[Ó&9Ó:�Ü�t �E•{Ó# aÔ'Ø˜S 6�\¨CÕ/Õ/‘Eà•O‘Eà˜•�Ø˜1•XÕŠEñ &ð �%Óñ 'ô  �iÓ
 €CßØ�x‰x‹zÐØ€JùòC *s   �H%z\x1b\[[0-9;]*mc                ó0   € V ^8„  d   QhR\         R\         /# )r	   Úsr   r   )r   s   "r   r   r   [   s   € ÷ $ñ $”3ð $œ3ñ $r   c                 ó@   € \         P                  R \        V 4      4      # )Ú )Ú_ansi_rer   r   )rC   s   &r   Ú_strip_ansirG   [   s   € Ü�<‰<˜œC ›FÓ#Ð#r   c           	      ó‚   € \        V 4      p\        ^ V\        \        V4      4      ,
          4      pVRV,          ,           # )r   Ú )r   Úmaxr   rG   )ÚtextÚwidthÚtÚpads   &&  r   Ú_padrO   _   s3   € ÜˆD‹	€AÜ
ˆa�œœ[¨›^Ó,Õ,Ó
-€CØˆs�S�y�=Ðr   c           
      ó¦  € V '       d   \        \        V.V ,           !  4      MV.pV Uu. uF  p\        R  V 4       4      NK  	  ppRP                  R \        W4       4       4      pRP                  R V 4       4      pV  Uu. uF$  pRP                  R \        Wt4       4       4      NK&  	  ppRP                  WV.V,           4      # u upi u upi )c              3   óJ   "  € T F  p\        \        V4      4      x € K  	  R # 5i©N)r   rG   )Ú.0Úxs   & r   Ú	<genexpr>Ú_make_table.<locals>.<genexpr>h   s   é € Ð3©s¨!”#”k !“n×%Ð%«sùs   ‚!#z | c              3   ó<   "  € T F  w  r\        W4      x € K  	  R # 5irR   ©rO   )rS   ÚhÚws   &  r   rU   rV   i   s   é € ÐIÑ4H©D¨AœT !ŸZ˜ZÓ4Hùó   ‚z-+-c              3   ó4   "  € T F  pR V,          x € K  	  R# 5i)Ú-N© )rS   rZ   s   & r   rU   rV   j   s   é € Ð2©6 a˜# Ÿ'š'«6ùs   ‚c              3   ó<   "  € T F  w  r\        W4      x € K  	  R # 5irR   rX   )rS   ÚcrZ   s   &  r   rU   rV   k   s   é € Ð=©n¡d a”t˜A—z�z«nùr[   Ú
)r   ÚziprJ   r   )	ÚrowsÚheadersÚcolsÚcolÚwidthsÚheader_lineÚsep_lineÚrÚbodys	   &&       r   Ú_make_tablerl   e   s´   € ç-1Œ4”�w�i $Õ&Ñ(Ô)¸°y€DÙ?CÓD¹t¸ŒcÑ3©sÓ3Ö3¹t€FÐDØ—*‘*ÑI´C¸Ô4HÓIÓI€KØ�z‰zÑ2©6Ó2Ó2€HÙGKÓLÁtÀ!ˆE�J‰JÑ=¬c°!¬nÓ=Ö=Át€DÐLØ�9‰9�kÐ,¨tÕ3Ó4Ð4ùò	 Eùò Ms   ªC	Â*CÚresetz[0mÚredz[31mÚyellowz[33mÚorangez[38;5;208mÚpurplez[35mÚgreenz[32mÚboldz[1mÚitalicz[3mÚdimz[2mc                ó®   € \         P                  eC   \         P                  P                  4       '       d   \        V,           V  \        R,           2# V # )zdReturn color/style-formatted input `s` if `sys.stdout` is interactive, e.g. connected to a terminal.rm   )ÚsysÚstdoutÚisattyÚPALETTE)rC   Úcolors   &&r   Ú_styler|   |   sA   € ä
‡z�zÒ¤#§*¡*×"3Ñ"3×"5Ò"5Ü˜%•.Ð! ! ¤W¨WÕ%5Ð$6Ð7Ð7àˆr   c                 óh   €  \         P                  ! 4       P                  #   \         d    T u # i ; irR   )ÚshutilÚget_terminal_sizeÚcolumnsÚ	Exception)Údefaults   &r   Ú_get_terminal_widthrƒ   „   s0   € ðÜ×'Ò'Ó)×1Ñ1Ð1øÜô ØŠðús   ‚! ¡1°1c          
      ó¸   € V ^8„  d   QhR\         R\        \        ,          R\        \        \        \
        3,          \        \        \
        3,          3,          /# )r	   ÚstageÚskipped_pp_keysr   )r   r.   r   Útupler%   r   )r   s   "r   r   r   ‹   sB   € ÷ ñ ÜðÜ25´cµ(ðä
Œ4””S��>œ4¤¤S �>Ð)Õ*ñr   c                ó  € VP                   p\        \        W4      P                  4      p\        P                  VP                  4       V P                  4      pV Uu/ uF  pV P                  WdV4      ;pf   K  WgbK  	  ppWX3# u upi )z@Map checkpoint keys to their owning PP rank for the load report.)	Úbase_model_prefixr   ÚgetattrÚlayersr%   ÚfromkeysÚ
state_dictÚpp_rankÚfind_rank_for_key)	r…   Úmodelr†   ÚprefixÚ
num_layersÚownedr
   ÚownerÚskippeds	   &&&      r   Ú_pp_report_key_ownersr–   ‹   s‹   € ð ×$Ñ$€FÜ”W˜UÓ+×2Ñ2Ó3€Jä�M‰M˜%×*Ñ*Ó,¨e¯m©mÓ<€Eñ #óá"ˆCØ×,Ñ,¨S¸fÓEÐEˆEô 	ˆŠ
Ù"ð ð ð
 ˆ>Ðùòs   ÁBÁ:Bc                   óR   a € ] tR t^›t o RtR tR tR	V 3R lR lltV 3R ltRt	V t
R# )
ÚLoadStateDictInfoa·  
Mutable container for state-dict loading results and diagnostics. Each entry in this structure is mutable,
and will usually be mutated in-place during the loading pipeline.

Attributes:
    missing_keys (`set[str]`):
        Keys that are missing from the loaded checkpoints but expected in the model's architecture.
    unexpected_keys (`set[str]`):
        Keys that are found in the checkpoints, but not expected in the model's architecture.
    skipped_pp_keys (`set[str]`):
        Checkpoint keys owned by another pipeline-parallel rank and intentionally not loaded here.
    mismatched_keys (`set[tuple[str, tuple[int], tuple[int]]]`):
        Keys that are found in the checkpoints and are expected in the model's architecture, but with a different shape.
    error_msgs ( `list[str]`):
        Some potential error messages.
    conversion_errors (`dict[str, str]`):
        Errors happening during the on-the-fly weight conversion process.
c                ór   € V P                   V P                   Uu0 uF  q^ ,          kK  	  up,          # u upi )zMReturn all effective missing keys, including `missing` and `mismatched` keys.)Úmissing_keysÚmismatched_keys)Úselfr4   s   & r   Úmissing_and_mismatchedÚ(LoadStateDictInfo.missing_and_mismatched·   s1   € à× Ñ °$×2FÒ2FÓ#GÑ2F¨Q a§D DÑ2FÑ#GÕGÐGùÒ#Gs   š4c                óf   € R V P                   RV P                  RV P                  RV P                  /# ©rš   Úunexpected_keysr›   Ú
error_msgsr    )rœ   s   &r   Úto_dictÚLoadStateDictInfo.to_dict»   s8   € ð ˜D×-Ñ-Ø˜t×3Ñ3Ø˜t×3Ñ3Ø˜$Ÿ/™/ð	
ð 	
r   Nc                ó.   <€ V ^8„  d   QhRS[ R,          /# )r	   r   Nr   )r   Ú__classdict__s   "€r   r   ÚLoadStateDictInfo.__annotate__Ä   s   ø€ ÷ Jñ J±3¸µ:ñ Jr   c           	     óŠ  € \        4       p. pRpV P                  '       de   VR\        RR4       R2\        RR4      ,           ,          p\        V P                  4       F#  p\        RR4      pVP	                  WVR	R	.4       K%  	  V P
                  '       dd   VR\        R
R4       R2\        RR4      ,           ,          p\        V P
                  4       F"  p\        RR4      pVP	                  WVR	.4       K$  	  V P                  '       d«   VR\        RR4       R2\        RR4      ,           ,          pV P                   UUU	u/ uF	  w  rxq—W‰3bK  	  p
ppp	\        V
4      P                  4        FB  w  pw  rÍ\        RR4      pVVR\        V4       R\        V4       2.pVP	                  V4       KD  	  V P                  '       dz   VR\        RR4       R2\        RR4      ,           ,          p\        V P                  4      P                  4        F*  w  r_\        RR4      pRV R2pVP	                  WVV.4       K,  	  RpVe   \        VRR4      pVeœ   \        VWP                  4      w  ppRRRV3RRR V33 Fr  w  ppppV'       g   K  VR\        V R!2V4       RV 2,          p\        V4      P                  4        F'  w  ppVP	                  V\        VV4      R"V 2.4       K)  	  Kt  	  \        V4      ^ 8X  d   R# R#R$.pV^È8”  d   VR%.,          pMVR	R	.,          p\        VVR&7      pVV,           pV# u up	ppi )'z/Generate the minimal table of a loading report.z

Notes:z
- zUNEXPECTED:rp   Ú	zbcan be ignored when loading from different task/architecture; not ok if you expect identical arch.rt   Ú
UNEXPECTEDrE   zMISSING:rn   zsthose params were newly initialized because missing from the checkpoint. Consider training on your downstream task.ÚMISSINGz	MISMATCH:ro   zRckpt weights were loaded, but they did not match the original empty weight shapes.ÚMISMATCHz$Reinit due to size mismatch - ckpt: z
 vs model:zCONVERSION:rq   z$originate from the conversion schemeÚ
CONVERSIONz

NÚ	_pp_stageÚOWNEDrr   z1checkpoint weights loaded on this pipeline stage.ÚSKIPPEDru   z3checkpoint weights owned by another pipeline stage.Ú:zPP rank ÚKeyÚStatusÚDetails)rd   )rƒ   r¡   r|   rA   r-   rš   r›   r*   r   Úconversion_errorsrŠ   r–   r†   r   rl   )rœ   r�   Úterm_wrc   Útipsr4   ÚstatusÚaÚbr`   Úiteratorr
   Ú
shape_ckptÚshape_modelÚdataÚvÚ_detailsr…   r“   r•   r{   ÚnoteÚ
key_ownersr”   rd   ÚtableÚreports   &&                         r   Úcreate_loading_reportÚ'LoadStateDictInfo.create_loading_reportÄ   sz  € ä$Ó&ˆàˆØˆà××ÐØ�dœ6 -°Ó:Ð;¸2Ð>ÄØtØóBõ õ ˆDô % T×%9Ñ%9Ö:�Ü ¨hÓ7�Ø—‘˜Q¨¨BÐ/Ö0ñ ;ð ××ÐØ�dœ6 *¨eÓ4Ð5°RÐ8¼6ð FØó<õ õ ˆDô % T×%6Ñ%6Ö7�Ü 	¨5Ó1�Ø—‘˜Q¨˜OÖ,ñ 8ð ××ÐØ�dœ6 +¨xÓ8Ð9¸Ð<¼vØdÐfnó@õ õ ˆDð 26×1EÒ1EÕFÑ1E¡g a¨A˜A˜6š	Ñ1EˆHÒFÜ2AÀ(Ó2K×2QÑ2QÖ2SÑ.�Ñ.�jÜ 
¨HÓ5�àØØ:¼3¸z»?Ð:KÈ:ÔVYÐZeÓVfÐUgÐhð�ð
 —‘˜DÖ!ñ 3Tð ×!×!Ð!Ø�dœ6 -°Ó:Ð;¸2Ð>ÄØ6¸óBõ õ ˆDô (¨×(>Ñ(>Ó?×EÑEÖG‘�Ü ¨hÓ7�Ø! !  D˜>�Ø—‘˜Q¨Ð1Ö2ñ Hð
 ˆØÒÜ˜E ;°Ó5ˆEØÒÜ2°5¸%×AUÑAUÓV‰NˆE�7à˜'Ð#VÐX]Ð^Ø˜EÐ#XÐZaÐbó4Ñ/�˜˜t Z÷ ‘:Ø˜d¤6¨V¨H°A¨,¸Ó#>Ð"?¸rÀ$ÀÐHÕH�DÜ&5°jÓ&A×&GÑ&GÖ&I™
˜˜UØŸ™ S¬&°¸Ó*?À8ÈEÈ7ÐASÐ$TÖUó 'Jñ4ô ˆt‹9˜Œ>Ùà˜(Ð#ˆØ�CŒ<Ø˜	�{Õ"‰Gà˜˜B�xÕˆGÜ˜D¨'Ô2ˆØ˜•ˆàˆùô[ Gs   ÅL>c                ó  <€ V ^8„  d   Qh/ S[ S[,          ;R&   S[ S[,          ;R&   S[ S[S[S[S[,          S[S[,          3,          ,          ;R&   S[S[,          ;R&   S[S[S[3,          ;R&   S[ S[,          ;R&   # )r	   rš   r¡   r›   r¢   rµ   r†   )r.   r   r‡   r   r   r%   )r   r¦   s   "€r   r   r§   ›   s„   ø‡ ‚ ñ* ‘c•(Ññ+ ñ, ™•XÑñ- ñ. ™™s¡E©#¥J±±cµ
Ð:Õ;Õ<Ñ<ñ/ ñ0 ‘S•	Ññ1 ñ2 ™C¡˜H•~Ñ%ñ3 ñ4 ™•XÑò5 r   r^   rR   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r�   r£   rÅ   Ú__annotate_func__Ú__static_attributes__Ú__classdictcell__)r¦   s   @r   r˜   r˜   ›   s)   ø‡ € ñò4Hò
÷Jò J÷S ƒ r   r˜   c          	      ój   € V ^8„  d   QhR\         R\        R\        R\        P                  R,          /# )r	   Úpretrained_model_name_or_pathÚignore_mismatched_sizesÚloading_infoÚloggerN)r   Úboolr˜   ÚloggingÚLogger)r   s   "r   r   r     s;   € ÷ -
ñ -
ä#&ð-
ô "ð-
ô $ð	-
ô
 �N‰N˜TÕ!ñ-
r   c                óª  € Vf   \         P                  ! \        4      pVP                  '       dQ   RP	                  VP                  4      pRV9   d
   VR,          p\        RV P                  P                   RV 24      hVP                  \         P                  4      '       d   T MRpVP                  V4      pVf   R# \        R,           V P                  P                   R\        R	,           R
V R2pVP                  W‡,           4       VP                  '       d   \        R4      hV'       g    VP                  '       d   \        R4      hR# R# )zÂ
Log a readable report about state_dict loading issues.

This version is terminal-size aware: for very small terminals it falls back to a compact
Key | Status view so output doesn't wrap badly.
Nz
	zsize mismatchzb
	You may consider adding `ignore_mismatched_sizes=True` to `from_pretrained(...)` if appropriate.z#Error(s) in loading state_dict for z:
	rs   z LOAD REPORTrm   z from: ra   zˆWe encountered some issues during automatic conversion of the weights. For details look at the `CONVERSION` entries of the above report!zjYou set `ignore_mismatched_sizes` to `False`, thus raising an error. For details look at the above report!)rÖ   Ú	getLoggerrÈ   r¢   r   ÚRuntimeErrorÚ	__class__ÚisEnabledForÚINFOrÅ   rz   Úwarningrµ   r›   )	r�   rÑ   rÒ   rÓ   rÔ   Ú	error_msgÚreport_modelrÄ   Úpreludes	   &&&&&    r   Úlog_state_dict_reportrâ     sF  € ð ‚~Ü×"Ò"¤8Ó,ˆð ××ÐØ—K‘K × 7Ñ 7Ó8ˆ	Ø˜iÔ'ØØvõˆIô Ð@ÀÇÁ×AYÑAYÐ@ZÐZ_Ð`iÐ_jÐkÓlÐlð #×/Ñ/´·±×=Ò=‘5À4€LØ×/Ñ/°Ó=€FØ‚~Ùä˜•Ð! %§/¡/×":Ñ":Ð!;¸<ÌÐPWÕHXÐGYÐY`Ða~Ð`ð  @Bð  C€Gð ‡N�N�7Õ#Ô$ð ×%×%Ð%Üð ó
ð 	
÷ # |×'C×'CÐ'CÜØxó
ð 	
ñ (DÑ"r   )é
   )éP   rR   )rÖ   Úrer~   rw   Úcollectionsr   r   Údataclassesr   Útypingr   Údistributed.pipeline_parallelr   Úcompiler   r   r"   rA   rF   rG   rO   rl   rz   r|   rƒ   r–   r˜   râ   r^   r   r   Ú<module>rë      sÌ   ðó Û 	Û Û 
ß 0Ý !Ý å 9ð �JŠJÐ.Ó/€	õ#÷
'õ*ðZ �:Š:Ð'Ó(€õ$òò5ð ˆVØ	ˆ7ØˆgØˆmØˆgØˆWØ
ˆFØˆfØ	ˆ6ð
€òôõð  ÷rð ró ðr÷j-
ñ -
r   