Ë
    Z²jJ  ã                   ó¨   — d dl Z d dlZd dlmZ d dlmZmZ d dlmZ e	Z
e	Zed   Ze G d„ d«      «       Ze G d„ d	«      «       Ze G d
„ d«      «       Zy)é    N)Údefaultdict)Ú	dataclassÚfield)ÚLiteral)
ÚF64ÚF32ÚF16ÚBF16ÚI64ÚI32ÚI16ÚI8ÚU8ÚBOOLc                   ód   — e Zd ZU dZeed<   ee   ed<   eeef   ed<    e	d¬«      Z
eed<   d
d	„Zy)Ú
TensorInfoa<  Information about a tensor.

    For more details regarding the safetensors format, check out https://huggingface.co/docs/safetensors/index#format.

    Attributes:
        dtype (`str`):
            The data type of the tensor ("F64", "F32", "F16", "BF16", "I64", "I32", "I16", "I8", "U8", "BOOL").
        shape (`list[int]`):
            The shape of the tensor.
        data_offsets (`tuple[int, int]`):
            The offsets of the data in the file as a tuple `[BEGIN, END]`.
        parameter_count (`int`):
            The number of parameters in the tensor.
    ÚdtypeÚshapeÚdata_offsetsF©ÚinitÚparameter_countNc                 ó˜   — 	 t        j                  t        j                  | j                  «      | _        y # t        $ r
 d| _        Y y w xY w)Né   )Ú	functoolsÚreduceÚoperatorÚmulr   r   Ú	TypeError)Úselfs    úa/var/www/html/ia-enhanced/venv/lib/python3.12/site-packages/huggingface_hub/utils/_safetensors.pyÚ__post_init__zTensorInfo.__post_init__#   s;   € ð	%Ü#,×#3Ñ#3´H·L±LÀ$Ç*Á*Ó#MˆDÕ øÜò 	%Ø#$ˆDÖ ð	%ús   ‚36 ¶A	ÁA	©ÚreturnN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚDTYPE_TÚ__annotations__ÚlistÚintÚtupler   r   r"   © ó    r!   r   r      s:   … ñð ƒNØ�‰9ÓØ˜˜S˜‘/Ó!Ù  eÔ,€O�SÓ,ô%r/   r   c                   óh   — e Zd ZU dZeeef   ed<   eeef   ed<    e	d¬«      Z
eeef   ed<   d	d„Zy)
ÚSafetensorsFileMetadataaÙ  Metadata for a Safetensors file hosted on the Hub.

    This class is returned by [`parse_safetensors_file_metadata`].

    For more details regarding the safetensors format, check out https://huggingface.co/docs/safetensors/index#format.

    Attributes:
        metadata (`dict`):
            The metadata contained in the file.
        tensors (`dict[str, TensorInfo]`):
            A map of all tensors. Keys are tensor names and values are information about the corresponding tensor, as a
            [`TensorInfo`] object.
        parameter_count (`dict[str, int]`):
            A map of the number of parameters per data type. Keys are data types and values are the number of parameters
            of that data type.
    ÚmetadataÚtensorsFr   r   Nc                 óÂ   — t        t        «      }| j                  j                  «       D ]#  }||j                  xx   |j
                  z  cc<   Œ% t        |«      | _        y ©N)r   r,   r3   Úvaluesr   r   Údict)r    r   Útensors      r!   r"   z%SafetensorsFileMetadata.__post_init__B   sQ   € Ü.9¼#Ó.>ˆØ—l‘l×)Ñ)Ó+ò 	DˆFØ˜FŸL™LÓ)¨V×-CÑ-CÑCÔ)ð	Dä# OÓ4ˆÕr/   r#   )r%   r&   r'   r(   r7   Ústrr*   ÚTENSOR_NAME_Tr   r   r   r)   r,   r"   r.   r/   r!   r1   r1   +   sD   … ñð" �3˜�8‰nÓØ�- Ð+Ñ,Ó,Ù*/°UÔ*;€O�T˜' 3˜,Ñ'Ó;ô5r/   r1   c                   ó‚   — e Zd ZU dZedz  ed<   eed<   eeef   ed<   eee	f   ed<    e
d¬«      Zeeef   ed	<   dd
„Zy)ÚSafetensorsRepoMetadataa  Metadata for a Safetensors repo.

    A repo is considered to be a Safetensors repo if it contains either a 'model.safetensors' weight file (non-shared
    model) or a 'model.safetensors.index.json' index file (sharded model) at its root.

    This class is returned by [`get_safetensors_metadata`].

    For more details regarding the safetensors format, check out https://huggingface.co/docs/safetensors/index#format.

    Attributes:
        metadata (`dict`, *optional*):
            The metadata contained in the 'model.safetensors.index.json' file, if it exists. Only populated for sharded
            models.
        sharded (`bool`):
            Whether the repo contains a sharded model or not.
        weight_map (`dict[str, str]`):
            A map of all weights. Keys are tensor names and values are filenames of the files containing the tensors.
        files_metadata (`dict[str, SafetensorsFileMetadata]`):
            A map of all files metadata. Keys are filenames and values are the metadata of the corresponding file, as
            a [`SafetensorsFileMetadata`] object.
        parameter_count (`dict[str, int]`):
            A map of the number of parameters per data type. Keys are data types and values are the number of parameters
            of that data type.
    Nr2   ÚshardedÚ
weight_mapÚfiles_metadataFr   r   c                 óÞ   — t        t        «      }| j                  j                  «       D ]1  }|j                  j                  «       D ]  \  }}||xx   |z  cc<   Œ Œ3 t        |«      | _        y r5   )r   r,   r?   r6   r   Úitemsr7   )r    r   Úfile_metadatar   Únb_parameters_s        r!   r"   z%SafetensorsRepoMetadata.__post_init__j   sl   € Ü.9¼#Ó.>ˆØ!×0Ñ0×7Ñ7Ó9ò 	9ˆMØ)6×)FÑ)F×)LÑ)LÓ)Nò 9Ñ%��~Ø Ó&¨.Ñ8Ô&ñ9ð	9ô  $ OÓ4ˆÕr/   r#   )r%   r&   r'   r(   r7   r*   Úboolr:   Ú
FILENAME_Tr1   r   r   r)   r,   r"   r.   r/   r!   r<   r<   I   sV   … ñð2 �T‰kÓØƒMØ�] JÐ.Ñ/Ó/Ø˜Ð%<Ð<Ñ=Ó=Ù*/°UÔ*;€O�T˜' 3˜,Ñ'Ó;ô5r/   r<   )r   r   Úcollectionsr   Údataclassesr   r   Útypingr   r9   rE   r:   r)   r   r1   r<   r.   r/   r!   ú<module>rI      sv   ðÛ Û Ý #ß (Ý ð €
Ø€Ø
ÐVÑ
W€ð ÷%ð %ó ð%ð: ÷5ð 5ó ð5ð: ÷%5ð %5ó ñ%5r/   