§
    ‚Štj_  ã                   ó¾   — d dl Z d dlZd dlmZ d dlZddlmZ ddlmZm	Z	m
Z
  e	¦   «         rd dlZ G d„ de¦  «        Z	 	 	 	 	 dd
edededz  dededededz  fd„ZdS )é    N)Úwrapsé   )Ú__version__é   )ÚExplicitEnumÚis_torch_availableÚis_torchdynamo_compilingc                   ó   — e Zd ZdZdZdZdZdS )ÚActionÚnoneÚnotifyÚnotify_alwaysÚraiseN)Ú__name__Ú
__module__Ú__qualname__ÚNONEÚNOTIFYÚNOTIFY_ALWAYSÚRAISE© ó    ú\/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/transformers/utils/deprecation.pyr   r      s"   € € € € € Ø€DØ€FØ#€MØ€E€E€Er   r   FÚold_nameÚversionÚnew_nameÚ warn_if_greater_or_equal_versionÚ!raise_if_greater_or_equal_versionÚraise_if_both_namesÚadditional_messagec                 óÚ   ‡ ‡‡‡‡‡‡
‡— t           j                             |¦  «        }t           j                             t          ¦  «        }||k    Š
‰
rd|› �Šnd|› �Šˆˆ
ˆˆ ˆˆˆˆfd„}	|	S )a[  
    Function or method decorator to notify users about deprecated keyword arguments, replacing them with a new name if specified.
    Note that is decorator is `torch.compile`-safe, i.e. it will not cause graph breaks (but no warning will be displayed if compiling).

    This decorator allows you to:
    - Notify users when a keyword argument is deprecated.
    - Automatically replace deprecated keyword arguments with new ones.
    - Raise an error if deprecated arguments are used, depending on the specified conditions.

    By default, the decorator notifies the user about the deprecated argument while the `transformers.__version__` < specified `version`
    in the decorator. To keep notifications with any version `warn_if_greater_or_equal_version=True` can be set.

    Parameters:
        old_name (`str`):
            Name of the deprecated keyword argument.
        version (`str`):
            The version in which the keyword argument was (or will be) deprecated.
        new_name (`Optional[str]`, *optional*):
            The new name for the deprecated keyword argument. If specified, the deprecated keyword argument will be replaced with this new name.
        warn_if_greater_or_equal_version (`bool`, *optional*, defaults to `False`):
            Whether to show warning if current `transformers` version is greater or equal to the deprecated version.
        raise_if_greater_or_equal_version (`bool`, *optional*, defaults to `False`):
            Whether to raise `ValueError` if current `transformers` version is greater or equal to the deprecated version.
        raise_if_both_names (`bool`, *optional*, defaults to `False`):
            Whether to raise `ValueError` if both deprecated and new keyword arguments are set.
        additional_message (`Optional[str]`, *optional*):
            An additional message to append to the default deprecation message.

    Raises:
        ValueError:
            If raise_if_greater_or_equal_version is True and the current version is greater than or equal to the deprecated version, or if raise_if_both_names is True and both old and new keyword arguments are provided.

    Returns:
        Callable:
            A wrapped function that handles the deprecated keyword arguments according to the specified parameters.

    Example usage with renaming argument:

        ```python
        @deprecate_kwarg("reduce_labels", new_name="do_reduce_labels", version="6.0.0")
        def my_function(do_reduce_labels):
            print(do_reduce_labels)

        my_function(reduce_labels=True)  # Will show a deprecation warning and use do_reduce_labels=True
        ```

    Example usage without renaming argument:

        ```python
        @deprecate_kwarg("max_size", version="6.0.0")
        def my_function(max_size):
            print(max_size)

        my_function(max_size=1333)  # Will show a deprecation warning
        ```

    z"and removed starting from version zand will be removed in version c                 óÚ   •‡ ‡‡— t          j        ‰ ¦  «        }t          |j                             ¦   «         ¦  «        }d|v Šd|v Št          ‰ ¦  «        ˆˆ ˆˆˆˆˆ	ˆ
ˆˆˆfd„¦   «         }|S )NÚselfÚclsc                  ó`  •— ‰j         }‰	r| d         j        j         › d|› �}n‰r| d         j         › d|› �}t          j        }d }‰|v rX‰
|v rT‰rt          j        nt          j        }d‰› d‰
› d|› d‰
› d|‰
         › d‰› d|‰         › d	�}|                     ‰¦  «         nZ‰|v r:‰
�8‰
|vr4t          j        }d
‰› d‰› d|› d‰
› d�	}|                     ‰¦  «        |‰
<   n‰|v rt          j        }d
‰› d‰› d|› d	�}|�	‰�|› d‰› �}‰r=‰r|t          j        k    rt          j        }n‰s|t          j        k    rt          j        }|t          j        k    rt          |¦  «        ‚|t          j        t          j        fv r*t          ¦   «         st          j        |t          d¬¦  «          ‰| i |¤ŽS )Nr   ú.zBoth `z` and `z` are set for `z
`. Using `ú=z` and ignoring deprecated `z`.ú`z` is deprecated z for `z`. Use `z
` instead.ú r   )Ú
stacklevel)r   Ú	__class__r   r   r   r   Úpopr   Ú
ValueErrorr	   ÚwarningsÚwarnÚFutureWarning)ÚargsÚkwargsÚ	func_nameÚminimum_actionÚmessager    ÚfuncÚis_class_methodÚis_greater_or_equal_versionÚis_instance_methodr   r   r   r   Úversion_messager   s        €€€€€€€€€€€r   Úwrapped_funcz6deprecate_kwarg.<locals>.wrapper.<locals>.wrapped_funcw   sœ  ø€ ð œˆIØ!ð >Ø# AœwÔ0Ô9ÐGÐG¸IÐGÐG�	�	Ø ð >Ø# AœwÔ/Ð=Ð=°)Ð=Ð=�	å#œ[ˆNØˆGð ˜6Ð!Ð! h°&Ð&8Ð&8Ø1DÐ!^¥¤ Í&ÔJ^�ð z 8ð  zð  z°Hð  zð  zÈYð  zð  zÐbjð  zð  zÐmsÐt|Ôm}ð  zð  zð  [cð  zð  zð  flð  muô  fvð  zð  zð  z�Ø—
’
˜8Ñ$Ô$Ð$Ð$ð ˜VÐ#Ð#¨Ð(<ÀÐQWÐAWÐAWÝ!'¤�Øv˜hÐvÐv¸ÐvÐvÈyÐvÐvÐbjÐvÐvÐv�Ø#)§:¢:¨hÑ#7Ô#7��xÑ Ð ð ˜VÐ#Ð#Ý!'¤�Ø\˜hÐ\Ð\¸Ð\Ð\ÈyÐ\Ð\Ð\�àÐ"Ð'9Ð'EØ$Ð;Ð;Ð'9Ð;Ð;�ð +ð 	1ð 5ð 1¸Í6Ì;Ò9VÐ9VÝ%+¤\�N�Nð :ð 1¸nÕPVÔP]Ò>]Ð>]Ý%+¤[�Nð ¥¤Ò-Ð-Ý  Ñ)Ô)Ð)à¥F¤Mµ6Ô3GÐ#HÐHÐHÕQiÑQkÔQkÐHå”˜g¥}ÀÐCÑCÔCÐCà�4˜Ð( Ð(Ð(Ð(r   )ÚinspectÚ	signatureÚsetÚ
parametersÚkeysr   )r6   ÚsigÚfunction_named_argsr;   r7   r9   r    r8   r   r   r   r   r:   r   s   `   @@€€€€€€€€r   Úwrapperz deprecate_kwarg.<locals>.wrapperp   s­   øøøø€ åÔ Ñ%Ô%ˆÝ! #¤.×"5Ò"5Ñ"7Ô"7Ñ8Ô8ÐØ#Ð':Ð:ÐØÐ#6Ð6ˆå	ˆt‰Œð3	)ð 3	)ð 3	)ð 3	)ð 3	)ð 3	)ð 3	)ð 3	)ð 3	)ð 3	)ð 3	)ð 3	)ð 3	)ð 3	)ñ 
Œð3	)ðj Ðr   )Ú	packagingr   Úparser   )r   r   r   r   r   r   r    Údeprecated_versionÚcurrent_versionrC   r8   r:   s   ` `````   @@r   Údeprecate_kwargrH   $   s¯   øøøøøøøø€ õF #Ô*×0Ò0°Ñ9Ô9ÐÝÔ'×-Ò-­kÑ:Ô:€OØ"1Ð5GÒ"GÐà"ð FØH¸wÐHÐHˆˆàE¸GÐEÐEˆð=ð =ð =ð =ð =ð =ð =ð =ð =ð =ð =ð =ð~ €Nr   )NFFFN)r<   r.   Ú	functoolsr   Úpackaging.versionrD   Ú r   r   r   r	   Útorchr   ÚstrÚboolrH   r   r   r   ú<module>rO      s9  ðð €€€Ø €€€Ø Ð Ð Ð Ð Ð à Ð Ð Ð à Ð Ð Ð Ð Ð Ø HÐ HÐ HÐ HÐ HÐ HÐ HÐ HÐ HÐ Hð ÐÑÔð Ø€L€L€Lðð ð ð ð ˆ\ñ ô ð ð  Ø-2Ø.3Ø %Ø%)ðKð KØðKàðKð �D‰jðKð '+ð	Kð
 (,ðKð ðKð ˜d™
ðKð Kð Kð Kð Kð Kr   