Ë
    ¹rœhV  ã                   óV   — d dl Z d dlZd dlZd dlmZ d dlmZmZ e G d„ d«      «       Zy)é    N)Ú	dataclass)ÚAnyÚUnionc                   óˆ   — e Zd ZU dZdZeed<   ed„ «       Zde	e
ej                  f   fd„Zdee
ef   fd„Zd	„ Zd
„ Zd„ Zd„ Zy)ÚDistributedConfigz,
    Base class for distributed configs
    FÚenable_expert_parallelc                 óÒ   —  | di |¤Ž}g }|j                  «       D ]0  \  }}t        ||«      sŒt        |||«       |j                  |«       Œ2 |D ]  }|j	                  |d«       Œ |S )aƒ  
        Constructs a DistributedConfig instance from a dictionary of parameters.
        Args:
            config_dict (Dict[str, Any]): Dictionary containing configuration parameters.
            **kwargs: Additional keyword arguments to override dictionary values.
        Returns:
            DistributedConfig: Instance of DistributedConfig constructed from the dictionary.
        N© )ÚitemsÚhasattrÚsetattrÚappendÚpop)ÚclsÚconfig_dictÚkwargsÚconfigÚ	to_removeÚkeyÚvalues          ú/var/www/html/ai-insurance-compliance-backend/venv/lib/python3.12/site-packages/transformers/distributed/configuration_utils.pyÚ	from_dictzDistributedConfig.from_dict   sw   € ñ Ñ#{Ñ#ˆØˆ	Ø Ÿ,™,›.ò 	&‰JˆCÜv˜sÕ#Ü˜  UÔ+Ø× Ñ  Õ%ð	&ð ò 	"ˆCØJ‰Js˜DÕ!ð	"àˆó    Újson_file_pathc                 óÂ   — t        |dd¬«      5 }| j                  «       }t        j                  |dd¬«      dz   }|j	                  |«       ddd«       y# 1 sw Y   yxY w)	aÂ  
        Save this instance to a JSON file.
        Args:
            json_file_path (`str` or `os.PathLike`):
                Path to the JSON file in which this configuration instance's parameters will be saved.
            use_diff (`bool`, *optional*, defaults to `True`):
                If set to `True`, only the difference between the config instance and the default
                `QuantizationConfig()` is serialized to JSON file.
        Úwzutf-8)Úencodingé   T)ÚindentÚ	sort_keysú
N)ÚopenÚto_dictÚjsonÚdumpsÚwrite)Úselfr   Úwriterr   Újson_strings        r   Úto_json_filezDistributedConfig.to_json_file4   sU   € ô . #°Ô8ð 	&¸FØŸ,™,›.ˆKÜŸ*™* [¸ÀdÔKÈdÑRˆKàL‰L˜Ô%÷		&÷ 	&ñ 	&ús   =AÁAÚreturnc                 ó@   — t        j                  | j                  «      S )z´
        Serializes this instance to a Python dictionary. Returns:
            `Dict[str, Any]`: Dictionary of all the attributes that make up this configuration instance.
        )ÚcopyÚdeepcopyÚ__dict__©r'   s    r   r#   zDistributedConfig.to_dictD   s   € ô
 }‰}˜TŸ]™]Ó+Ð+r   c              #   ó‚   K  — t        j                  | j                  «      j                  «       D ]  \  }}||f–— Œ y­w)zTallows `dict(obj)` for situations where obj may be a dict or QuantizationConfigMixinN)r-   r.   r/   r   )r'   Úattrr   s      r   Ú__iter__zDistributedConfig.__iter__L   s9   è ø€ äŸ=™=¨¯©Ó7×=Ñ=Ó?ò 	‰KˆD%Ø˜+Óñ	ùs   ‚=?c                 óT   — | j                   j                  › d| j                  «       › S )Nú )Ú	__class__Ú__name__Úto_json_stringr0   s    r   Ú__repr__zDistributedConfig.__repr__R   s(   € Ø—.‘.×)Ñ)Ð*¨!¨D×,?Ñ,?Ó,AÐ+BÐCÐCr   c                 óJ   — t        j                  | j                  d¬«      dz   S )z§
        Serializes this instance to a JSON formatted string.
        Returns:
            str: JSON formatted string representing the configuration instance.
        r   )r   r!   )r$   r%   r/   r0   s    r   r8   z DistributedConfig.to_json_stringU   s   € ô z‰z˜$Ÿ-™-°Ô2°TÑ9Ð9r   c                 óì   — g }|j                  «       D ]0  \  }}t        | |«      sŒt        | ||«       |j                  |«       Œ2 |j                  «       D ci c]  \  }}||vsŒ||“Œ }}}|S c c}}w )a­  
        Updates attributes of this class instance with attributes from `kwargs` if they match existing attributes,
        returning all the unused kwargs.
        Args:
            kwargs (`Dict[str, Any]`):
                Dictionary of attributes to tentatively update this class.
        Returns:
            `Dict[str, Any]`: Dictionary containing all the key-value pairs that were not used to update the instance.
        )r   r   r   r   )r'   r   r   r   r   Úunused_kwargss         r   ÚupdatezDistributedConfig.update]   s}   € ð ˆ	Ø Ÿ,™,›.ò 	&‰JˆCÜt˜SÕ!Ü˜˜c 5Ô)Ø× Ñ  Õ%ð	&ð 7=·l±l³n×]©
¨¨UÈÐS\ÒH\˜˜e™Ð]ˆÑ]ØÐùó ^s   ÁA0Á&A0N)r7   Ú
__module__Ú__qualname__Ú__doc__r   ÚboolÚ__annotations__Úclassmethodr   r   ÚstrÚosÚPathLiker*   Údictr   r#   r3   r9   r8   r=   r
   r   r   r   r      sk   … ñð $)Ð˜DÓ(ð ñó ðð(&¨5°°b·k±kÐ1AÑ+Bó &ð ,˜˜c 3˜h™ó ,òòDò:ór   r   )	r-   r$   rE   Údataclassesr   Útypingr   r   r   r
   r   r   ú<module>rJ      s2   ðó Û Û 	Ý !ß ð ÷Xð Xó ñXr   