+
    IV-jv$  ã                   óV  € ^ RI t ^ RIt^ RIHtHtHtHtHt ^ RIt	^ RI
t
^ RIHtHtHtHtHtHt R&R R lltR&R R lltR'R R	 lltR'R
R/R R llltR'R R lltR R lt]
P.                  ^]
P0                  ^]
P2                  ^]
P4                  ^]
P6                  ^]
P8                  ^]
P:                  ^]
P<                  ^]
P>                  ^]
P@                  ^]
PB                  ^]
PD                  ^]
PF                  ^/t$R]
P@                  R]
P0                  R]
P6                  R]
P4                  R]
P.                  R]
P2                  R]
P8                  R]
P<                  R]
P:                  R]
P>                  R]
PB                  R]
PD                  /t%]
P.                  ]	P.                  ]
P0                  ]	P0                  ]
P2                  ]	P2                  ]
P4                  ]	P6                  ]
P6                  ]	P6                  ]
P8                  ]	P8                  ]
P:                  ]	P:                  ]
P<                  ]	P<                  ]
P>                  ]]
P@                  ]	P@                  ]
PB                  ]	P:                  ]
PD                  ]	P:                  /t&R R lt'R  R! lt(R" R# lt)R$ R% lt*R# )(é    N)ÚAnyÚDictÚListÚOptionalÚUnion)Ú
TensorSpecÚnumpyÚdeserializeÚ	safe_openÚ	serializeÚserialize_filec                óª   € V ^8„  d   QhR\         \        \        P                  3,          R\        \         \        \        3,          ,          R\
        /# )é   ÚtensorsÚmetadataÚreturn)r   ÚstrÚpaddleÚTensorr   Úbytes)Úformats   "Úc/Volumes/fast/ai/experiments/ui-tars-smoke/.venv/lib/python3.14/site-packages/safetensors/paddle.pyÚ__annotate__r      s?   € ÷ ñ Ü”#”v—}‘}Ð$Õ%ðÜ19¼$¼sÄC¸x½.Õ1Iðä
ñó    c                óL   € . p\        \        W4      VR7      p\        V4      pV# )aá  
Saves a dictionary of tensors into raw bytes in safetensors format.

Args:
    tensors (`Dict[str, paddle.Tensor]`):
        The incoming tensors. Tensors need to be contiguous and dense.
    metadata (`Dict[str, str]`, *optional*, defaults to `None`):
        Optional text only metadata you might want to save in your header.
        For instance it can be useful to specify more about the underlying
        tensors. This is purely informative and does not affect tensor loading.

Returns:
    `bytes`: The raw bytes representing the format

Example:

```python
from safetensors.paddle import save
import paddle

tensors = {"embedding": paddle.zeros((512, 1024)), "attention": paddle.zeros((256, 256))}
byte_data = save(tensors)
```
©r   )r   Ú_flattenr   )r   r   Úkeep_references_aliveÚ
serializedÚresults   &&   r   Úsaver!      s*   € ð6 ÐÜœ8 GÓCÈhÔW€JÜ�:Ó€FØ€Mr   c          	      óä   € V ^8„  d   QhR\         \        \        P                  3,          R\        \        \
        P                  3,          R\        \         \        \        3,          ,          RR/# )r   r   Úfilenamer   r   N)r   r   r   r   r   ÚosÚPathLiker   )r   s   "r   r   r   3   sY   € ÷ "ñ "Ü”#”v—}‘}Ð$Õ%ð"ä”CœŸ™Ð$Õ%ð"ô ”tœC¤˜H•~Õ&ð"ð 
ñ	"r   c                ó6   € . p\        \        W4      WR7       R# )a  
Saves a dictionary of tensors into raw bytes in safetensors format.

Args:
    tensors (`Dict[str, paddle.Tensor]`):
        The incoming tensors. Tensors need to be contiguous and dense.
    filename (`str`, or `os.PathLike`)):
        The filename we're saving into.
    metadata (`Dict[str, str]`, *optional*, defaults to `None`):
        Optional text only metadata you might want to save in your header.
        For instance it can be useful to specify more about the underlying
        tensors. This is purely informative and does not affect tensor loading.

Returns:
    `None`

Example:

```python
from safetensors.paddle import save_file
import paddle

tensors = {"embedding": paddle.zeros((512, 1024)), "attention": paddle.zeros((256, 256))}
save_file(tensors, "model.safetensors")
```
r   N)r   r   )r   r#   r   r   s   &&& r   Ú	save_filer'   3   s   € ð> ÐÜÜ�Ó0°(÷r   c                ór   € V ^8„  d   QhR\         R\        R\        \        \        P                  3,          /# )r   ÚdataÚdevicer   )r   r   r   r   r   )r   s   "r   r   r   X   s/   € ÷ (ñ (Œuð (œcð (¬d´3¼¿¹Ð3EÕ.Fñ (r   c                óš   € \         P                  R8¼  d   \        V 4      p\        W!4      # \        P
                  ! V 4      p\        W!4      # )a¦  
Loads a safetensors file into paddle format from pure bytes.

Args:
    data (`bytes`):
        The content of a safetensors file

Returns:
    `Dict[str, paddle.Tensor]`: dictionary that contains name as key, value as `paddle.Tensor` on cpu

Example:

```python
from safetensors.paddle import load

file_path = "./my_folder/bert.safetensors"
with open(file_path, "rb") as f:
    data = f.read()

loaded = load(data)
```
ú3.2.0)r   Ú__version__r
   Ú_view2paddler	   ÚloadÚ
_np2paddle)r)   r*   Úflats   && r   r/   r/   X   s@   € ô. ×Ñ˜WÔ$Ü˜4Ó ˆÜ˜DÓ)Ð)ä�zŠz˜$ÓˆÜ˜$Ó'Ð'r   ÚbackendÚmmapc                ó¨   € V ^8„  d   QhR\         \        \        P                  3,          R\        R\        \        \
        P                  3,          /# )r   r#   r2   r   )r   r   r$   r%   r   r   r   )r   s   "r   r   r   w   s@   € ÷ "$ñ "$Ü”CœŸ™Ð$Õ%ð"$ÜADð"$ä	Œ#Œv�}‰}Ð
Õñ"$r   c               óø   € \         P                  R8¼  d2   \        V RWR7      ;_uu_ 4       pVP                  4       uuRRR4       # \        P
                  ! WR7      p\        WA4      #   + '       g   i     L2; i)a  
Loads a safetensors file into paddle format.

Args:
    filename (`str`, or `os.PathLike`)):
        The name of the file which contains the tensors
    device (`Union[Dict[str, any], str]`, *optional*, defaults to `cpu`):
        The device where the tensors need to be located after load.
        available options are all regular paddle device locations
    backend (`str`, *optional*, defaults to `"mmap"`):
        Storage backend used to serve tensor bytes. `"mmap"` (default)
        and `"pread"` uses `pread(2)` to read tensor bytes.

Returns:
    `Dict[str, paddle.Tensor]`: dictionary that contains name as key, value as `paddle.Tensor`

Example:

```python
from safetensors.paddle import load_file

file_path = "./my_folder/bert.safetensors"
loaded = load_file(file_path)
```
r,   r   )Ú	frameworkr*   r2   N)r2   )r   r-   r   Úget_tensorsr	   Ú	load_filer0   )r#   r*   r2   Úfr1   s   &&$  r   r8   r8   w   sb   € ô8 ×Ñ˜WÔ$ÜØ °÷
õ 
àØ—=‘=“?÷
ò 
ô �?Š?˜8Ô5€DÜ�dÓ#Ð#÷
÷ 
ús   ¬A)Á)A9	c                ó¨   € V ^8„  d   QhR\         \        \        P                  3,          R\        R\         \        \        P
                  3,          /# )r   Ú
numpy_dictr*   r   )r   r   ÚnpÚndarrayr   r   )r   s   "r   r   r   œ   s?   € ÷ ñ Ü”Sœ"Ÿ*™*�_Õ%ðÜ/2ðä	Œ#Œv�}‰}Ð
Õñr   c                 ój   € V P                  4        F  w  r#\        P                  ! W1R 7      W&   K   	  V # )©Úplace)Úitemsr   Ú	to_tensor)r;   r*   ÚkÚvs   &&  r   r0   r0   œ   s1   € ð × Ñ Ö"‰ˆÜ×(Ò(¨Ô9ˆ
‹ñ #àÐr   c                óœ   € V ^8„  d   QhR\         \        \        P                  3,          R\         \        \        P
                  3,          /# )r   Úpaddle_dictr   )r   r   r   r   r<   Úarray)r   s   "r   r   r   ¤   s5   € ÷ ñ œD¤¤f§m¡mÐ!3Õ4ð ¼¼cÄ2Ç8Á8¸mÕ9Lñ r   c                 ó”   € V P                  4        F3  w  rVP                  4       P                  4       P                  4       W&   K5  	  V # ©N)rA   ÚdetachÚcpur	   )rF   rC   rD   s   &  r   Ú
_paddle2nprL   ¤   s:   € Ø×!Ñ!Ö#‰ˆØŸ™›Ÿ™Ó)×/Ñ/Ó1ˆ‹ñ $àÐr   ÚF64ÚF32ÚF16ÚBF16ÚI64ÚI32ÚI16ÚI8ÚU8ÚBOOLÚF8_E4M3ÚF8_E5M2c                óD   € V ^8„  d   QhR\         R\        P                  /# )r   Ú	dtype_strr   )r   r   Údtype)r   s   "r   r   r   á   s   € ÷ ñ œð ¤§¡ñ r   c                 ó   € \         V ,          # rI   )Ú_TYPES)rZ   s   &r   Ú	_getdtyper^   á   s   € Ü�)ÕÐr   c                óZ   € V ^8„  d   QhR\         \        \        P                  3,          /# )r   r   )r   r   r   r   )r   s   "r   r   r   å   s!   € ÷ ñ ¤d¬3´·±Ð+=Õ&>ñ r   c                 ó¦  € / pV  EFG  w  r4\        VR ,          4      p\        VR,          4      ^ 8X  dk   \        ;QJ d#    R VR,           4       F  '       g   K   RM	  RM! R VR,           4       4      '       g   Q h\        P                  ! VR,          VR7      pM_\        P
                  P                  P                  VR,          V4      P                  VR,          4      pVR8w  d   VP                  V4      p\        P                  R8X  d7   \        P                  ! VP                  4       P                  RR	7      VR
7      pWbV&   EKJ  	  V# )r[   r)   c              3   ó*   "  € T F	  q^ 8H  x € K  	  R# 5i)r   N© )Ú.0Úxs   & r   Ú	<genexpr>Ú_view2paddle.<locals>.<genexpr>ë   s   é € Ð2¡z !˜A–v£zùs   ‚ÚshapeTF)r[   rK   Úbig©Úinplacer?   )r^   ÚlenÚanyr   ÚemptyÚbaseÚcoreÚ
frombufferÚreshapeÚtoÚsysÚ	byteorderrB   r	   Úbyteswap)Úsafeviewr*   r    rC   rD   r[   Úarrs   &&     r   r.   r.   å   s÷   € Ø€FÜ‰ˆÜ˜!˜G�*Ó%ˆÜˆq��y‹>˜QÔç“3Ñ2 q¨¦zÓ2—3—3’3Ñ2 q¨¦zÓ2×2Ò2Ð2Ð2Ü—,’,˜q �z°Ô7‰Cä—+‘+×"Ñ"×-Ñ-¨a°­i¸Ó?×GÑGÈÈ'Í
ÓSˆCØ˜ŒØ—f‘f˜V“n�Ü�=‰=˜EÔ!Ü×"Ò" 3§9¡9£;×#7Ñ#7ÀÐ#7Ó#FÈfÔUˆCØˆqŒ	ñ ð €Mr   c                óD   € V ^8„  d   QhR\         P                  R\        /# )r   ÚtensorÚname)r   r   r   )r   s   "r   r   r   ø   s   € ÷  ñ  œŸ™ð  ¬Sñ  r   c                 óò  € V P                  4       '       g   \        R V R24      hV P                  P                  4       '       g   V P	                  4       p ^ RIp\        \        P                  ! V P                  4      P                  4       4      p\        V P                  ,          pW4,          pV P                  4       pV^ 8X  d   \        P                  ! ^ 4      ^ 3# VP                  WbP!                  VP"                  4      4      p\        P$                  P'                  Wu34      p\(        P*                  R8X  d9   \,        V P                  ,          p	VP/                  V	4      P1                  RR7      pW€3# )z1You are trying to save a non contiguous tensor: `a  ` which is not allowed. It either means you are trying to save tensors which are reference of each other in which case it's recommended to save only the full tensors, and reslice at load time, or simply call `.contiguous()` on your tensor to pack it before saving.Nrh   Fri   )Úis_contiguousÚ
ValueErrorr@   Úis_cpu_placerK   ÚctypesÚintr<   Úprodrg   ÚitemÚ_SIZEr[   Údata_ptrrm   ÚcastÚPOINTERÚc_ubyteÚ	ctypeslibÚas_arrayrs   rt   ÚNPDTYPESÚviewru   )
ry   rz   r   ÚlengthÚbytes_per_itemÚtotal_bytesÚptrÚnewptrr)   Únpdtypes
   &&        r   Ú_to_ndarrayr’   ø   s+  € Ø×Ñ×!Ò!ÜØ?À¸vð F&ð &ó
ð 	
ð �<‰<×$Ñ$×&Ò&à—‘“ˆãô ”—’˜Ÿ™Ó&×+Ñ+Ó-Ó.€FÜ˜6Ÿ<™<Õ(€NàÕ)€Kà
�/‰/Ó
€CØ
ˆa„xÜ�xŠxØó
àðð 	ð �[‰[˜Ÿn™n¨V¯^©^Ó<Ó=€FÜ�<‰<× Ñ  ¨Ó8€DÜ
‡}�}˜ÔÜ˜6Ÿ<™<Õ(ˆà�y‰y˜Ó!×*Ñ*°5Ð*Ó9ˆØˆ<Ðr   c          
      ó¶   € V ^8„  d   QhR\         \        \        P                  3,          R\        R\         \        \         \        \
        3,          3,          /# )r   r   Úkeep_alive_bufferr   )r   r   r   r   r   r   )r   s   "r   r   r     sD   € ÷ ñ Ü”#”v—}‘}Ð$Õ%ðÜ:>ðä	Œ#Œt”Cœ�H�~Ð
Õñr   c           	      ó>  € \        V \        4      '       g   \        R \        V 4       24      hV P	                  4        F?  w  r#\        V\
        P                  4      '       d   K'  \        RV R\        V4       24      h	  / pV P	                  4        F†  w  r#\        W24      w  rVVP                  WV34       \        \        VP                  4      P                  R4      R,          VP                  VP                  P                  VP                   R7      WB&   Kˆ  	  V# )z5Expected a dict of [str, paddle.Tensor] but received zKey `z2` is invalid, expected paddle.Tensor but received Ú.)r[   rg   r„   Údata_lenéÿÿÿÿ)Ú
isinstanceÚdictr}   ÚtyperA   r   r   r’   Úappendr   r   r[   Úsplitrg   r   r)   Únbytes)r   r”   rC   rD   Ú	flattenedrw   Ú
tensor_refs   &&     r   r   r     sò   € ô �gœt×$Ò$ÜØCÄDÈÃMÀ?ÐSó
ð 	
ð —‘–‰ˆÜ˜!œVŸ]™]×+Ô+ÜØ˜�sÐLÌTÐRSËWÈIÐVóð ñ  ð €IØ—‘–‰ˆÜ% aÓ+‰ˆØ× Ñ  #Ð!2Ô3Ü!Ü�a—g‘g“,×$Ñ$ SÓ)¨"Õ-Ø—'‘'Ø—Z‘Z—_‘_Ø—Z‘Zô	
ˆ	‹ñ  ð Ðr   rI   )rK   )+r$   rs   Útypingr   r   r   r   r   r	   r<   r   Úsafetensorsr   r
   r   r   r   r!   r'   r/   r8   r0   rL   Úint64Úfloat32Úint32Úbfloat16Úfloat16Úint16Úuint8Úint8ÚboolÚfloat64Úfloat8_e4m3fnÚfloat8_e5m2Ú	complex64rƒ   r]   rŠ   r^   r.   r’   r   rb   r   r   Ú<module>r°      s  ðÛ 	Û 
ß 3Õ 3ã Û ÷÷ ÷÷B"÷J(ñ>"$ØGM÷"$ð "$÷Jõð ‡L�L�!Ø
‡N�N�AØ
‡L�L�!Ø
‡O�O�QØ
‡N�N�AØ
‡L�L�!Ø
‡L�L�!Ø
‡K�K�Ø
‡K�K�Ø
‡N�N�AØ
×Ñ˜!Ø
×Ñ˜Ø
×Ñ�að	€ð. 
ˆ6�>‰>Ø	ˆ6�>‰>Ø	ˆ6�>‰>Ø
ˆF�O‰OØ	ˆ6�<‰<Ø	ˆ6�<‰<Ø	ˆ6�<‰<Øˆ&�+‰+Øˆ&�,‰,Ø
ˆF�K‰KØˆv×#Ñ#Øˆv×!Ñ!ð
€ð  ‡L�L�"—(‘(Ø
‡N�N�B—J‘JØ
‡L�L�"—(‘(à
‡O�O�R—Z‘ZØ
‡N�N�B—J‘JØ
‡L�L�"—(‘(Ø
‡L�L�"—(‘(Ø
‡K�K�—‘Ø
‡K�K�Ø
‡N�N�B—J‘Jà
×Ñ˜"Ÿ(™(Ø
×Ñ˜Ÿ™ð€õ$õõ& ÷Fr   