§
    Ý˜ºhV  ã                   ód   — 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dS )é    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dS )ÚDistributedConfigz,
    Base class for distributed configs
    FÚenable_expert_parallelc                 óð   —  | di |¤Ž}g }|                      ¦   «         D ];\  }}t          ||¦  «        r&t          |||¦  «         |                     |¦  «         Œ<|D ]}|                     |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          út/var/www/html/services/rag-service/venv/lib/python3.11/site-packages/transformers/distributed/configuration_utils.pyÚ	from_dictzDistributedConfig.from_dict   s�   € ð �Ð#Ð#�{Ð#Ð#ˆØˆ	Ø Ÿ,š,™.œ.ð 	&ð 	&‰JˆC�Ý�v˜sÑ#Ô#ð &Ý˜  UÑ+Ô+Ð+Ø× Ò  Ñ%Ô%Ð%øØð 	"ð 	"ˆCØ�JŠJ�s˜DÑ!Ô!Ð!Ð!Øˆó    Újson_file_pathc                 óâ   — t          |dd¬¦  «        5 }|                      ¦   «         }t          j        |dd¬¦  «        dz   }|                     |¦  «         ddd¦  «         dS # 1 swxY w Y   dS )	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   s´   € õ �. #°Ð8Ñ8Ô8ð 	&¸FØŸ,š,™.œ.ˆKÝœ* [¸ÀdÐKÑKÔKÈdÑRˆKà�LŠL˜Ñ%Ô%Ð%ð		&ð 	&ð 	&ñ 	&ô 	&ð 	&ð 	&ð 	&ð 	&ð 	&ð 	&ð 	&øøøð 	&ð 	&ð 	&ð 	&ð 	&ð 	&s   “AA$Á$A(Á+A(Úreturnc                 ó4   — 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              #   óx   K  — t          j        | j        ¦  «                             ¦   «         D ]\  }}||fV — ŒdS )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   sN   è è € åœ=¨¬Ñ7Ô7×=Ò=Ñ?Ô?ð 	ð 	‰KˆD�%Ø˜�+ÐÐÐÐð	ð 	r   c                 óH   — | j         j        › d|                      ¦   «         › �S )Nú )Ú	__class__Ú__name__Úto_json_stringr0   s    r   Ú__repr__zDistributedConfig.__repr__R   s'   € Ø”.Ô)ÐCÐC¨D×,?Ò,?Ñ,AÔ,AÐCÐCÐCr   c                 ó>   — 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˜$œ-°Ð2Ñ2Ô2°TÑ9Ð9r   c                 óì   ‡— g Š|                      ¦   «         D ];\  }}t          | |¦  «        r&t          | ||¦  «         ‰                     |¦  «         Œ<ˆfd„|                      ¦   «         D ¦   «         }|S )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.
        c                 ó$   •— i | ]\  }}|‰v¯	||“ŒS r
   r
   )Ú.0r   r   r   s      €r   ú
<dictcomp>z,DistributedConfig.update.<locals>.<dictcomp>n   s*   ø€ Ð]Ð]Ð]©
¨¨UÈÐS\ÐH\ÐH\˜˜eÐH\ÐH\ÐH\r   )r   r   r   r   )r'   r   r   r   Úunused_kwargsr   s        @r   ÚupdatezDistributedConfig.update]   sˆ   ø€ ð ˆ	Ø Ÿ,š,™.œ.ð 	&ð 	&‰JˆC�Ý�t˜SÑ!Ô!ð &Ý˜˜c 5Ñ)Ô)Ð)Ø× Ò  Ñ%Ô%Ð%øð ^Ð]Ð]Ð]°f·l²l±n´nÐ]Ñ]Ô]ˆØÐr   N)r7   Ú
__module__Ú__qualname__Ú__doc__r   ÚboolÚ__annotations__Úclassmethodr   r   ÚstrÚosÚPathLiker*   Údictr   r#   r3   r9   r8   r@   r
   r   r   r   r      s×   € € € € € € ðð ð $)Ð˜DÐ(Ð(Ñ(ð ðð ñ „[ðð(&¨5°°b´kÐ1AÔ+Bð &ð &ð &ð &ð ,˜˜c 3˜hœð ,ð ,ð ,ð ,ðð ð ðDð Dð Dð:ð :ð :ðð ð ð ð r   r   )	r-   r$   rH   Údataclassesr   Útypingr   r   r   r
   r   r   ú<module>rM      s”   ðð €€€Ø €€€Ø 	€	€	€	Ø !Ð !Ð !Ð !Ð !Ð !Ø Ð Ð Ð Ð Ð Ð Ð ð ðXð Xð Xð Xð Xñ Xô Xñ „ðXð Xð Xr   