Ë µL iVãóV—ddlZddlZddlZddlmZddlmZmZeGd„d««Zy)éN)Ú dataclass)ÚAnyÚUnioncóˆ—eZdZUdZdZeed<ed„«Zde e e jffd„Z dee effd„Zd „Zd „Zd „Zd „Zy )ÚDistributedConfigz, Base class for distributed configs FÚenable_expert_parallelc óÒ—|di|¤Ž}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 úr/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/transformers/distributed/configuration_utils.pyÚ from_dictzDistributedConfig.from_dictsw€ñÑ#{Ñ#ˆØˆ Ø Ÿ,™,›.ò &‰JˆCÜv˜sÕ#ܘ  UÔ+Ø× Ñ  Õ%ð &ðò "ˆCØ J‰Js˜DÕ !ð "àˆ óÚjson_file_pathcó—t|dd¬«5}|j«}tj|dd¬«dz}|j |«ddd«y#1swYyxYw) 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. Úwzutf-8)ÚencodingéT)ÚindentÚ sort_keysú N)ÚopenÚto_dictÚjsonÚdumpsÚwrite)ÚselfrÚwriterrÚ json_strings rÚ to_json_filezDistributedConfig.to_json_file4sU€ô. #°Ô 8ð &¸FØŸ,™,›.ˆKÜŸ*™* [¸ÀdÔKÈdÑRˆKà L‰L˜Ô %÷  &÷ &ñ &ús =AÁAÚreturncó@—tj|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 rr#zDistributedConfig.to_dictDs€ô }‰}˜TŸ]™]Ó+Ð+rc#ó‚K—tj|j«j«D] \}}||f–—Œ y­w)zTallows `dict(obj)` for situations where obj may be a dict or QuantizationConfigMixinN)r-r.r/r )r'Úattrrs rÚ__iter__zDistributedConfig.__iter__Ls9èø€äŸ=™=¨¯©Ó7×=Ñ=Ó?ò ‰KˆD%ؘ+Ó ñ ùs‚=?cóT—|jj›d|j«›S)Nú )Ú __class__Ú__name__Úto_json_stringr0s rÚ__repr__zDistributedConfig.__repr__Rs(€Ø—.‘.×)Ñ)Ð*¨!¨D×,?Ñ,?Ó,AÐ+BÐCÐCrcóJ—tj|jd¬«dzS)z§ Serializes this instance to a JSON formatted string. Returns: str: JSON formatted string representing the configuration instance. r)rr!)r$r%r/r0s rr8z DistributedConfig.to_json_stringUs€ô z‰z˜$Ÿ-™-°Ô2°TÑ9Ð9rc óì—g}|j«D]0\}}t||«sŒt|||«|j|«Œ2|j«Dcic] \}}||vsŒ ||“Œ}}}|Scc}}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'rrrrÚ unused_kwargss rÚupdatezDistributedConfig.update]s}€ðˆ Ø Ÿ,™,›.ò &‰JˆCÜt˜SÕ!ܘ˜c 5Ô)Ø× Ñ  Õ%ð &ð 7=·l±l³n×]© ¨¨UÈÐS\ÒH\˜˜e™Ð]ˆ Ñ]ØÐùó^s Á A0Á&A0N)r7Ú __module__Ú __qualname__Ú__doc__rÚboolÚ__annotations__Ú classmethodrrÚstrÚosÚPathLiker*Údictrr#r3r9r8r=r rrrrsk…ñð$)ИDÓ(ðñóðð(&¨5°°b·k±kÐ1AÑ+Bó&ð ,˜˜c 3˜h™ó,òò Dò:órr) r-r$rEÚ dataclassesrÚtypingrrrr rrúrJs2ðó Û Û Ý!ßð ÷XðXó ñXr