§
    ‚Štj;†  ã                   ó¦  — d Z ddlZ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 ddlmZ ddlmZ  ej        e¦  «        Ze G d	„ d
¦  «        ¦   «         Z G d„ d¦  «        Ze G d„ de¦  «        ¦   «         Z G d„ d¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ dee¦  «        ZdS )zJ
Callbacks to use with the Trainer class and customize the training loop.
é    N)Ú	dataclass)Útqdmé   )ÚIntervalStrategyÚSaveStrategyÚ
has_length)ÚTrainingArguments)Úloggingc                   óÚ  — e Zd ZU dZdZeed<   dZeed<   dZ	eed<   dZ
eed<   dZeed<   dZeed	<   d
Zed
z  ed<   dZeed<   dZeed<   dZeed<   d
Zeeeef                  ed<   d
Zed
z  ed<   d
Zed
z  ed<   d
Zed
z  ed<   dZeed<   dZeed<   dZeed<   d
Zed
z  ed<   d
Zeeeez  ez  ez  f         d
z  ed<   d
Zed         d
z  ed<   d„ Zdefd„Z e!defd„¦   «         Z"d „ Z#d!„ Z$d
S )"ÚTrainerStateaŸ  
    A class containing the [`Trainer`] inner state that will be saved along the model and optimizer when checkpointing
    and passed to the [`TrainerCallback`].

    <Tip>

    In all this class, one step is to be understood as one update step. When using gradient accumulation, one update
    step may require several forward and backward passes: if you use `gradient_accumulation_steps=n`, then one update
    step requires going through *n* batches.

    </Tip>

    Args:
        epoch (`float`, *optional*):
            Only set during training, will represent the epoch the training is at (the decimal part being the
            percentage of the current epoch completed).
        global_step (`int`, *optional*, defaults to 0):
            During training, represents the number of update steps completed.
        max_steps (`int`, *optional*, defaults to 0):
            The number of update steps to do during the current training.
        logging_steps (`int`, *optional*, defaults to 500):
            Log every X updates steps
        eval_steps (`int`, *optional*):
            Run an evaluation every X steps.
        save_steps (`int`, *optional*, defaults to 500):
            Save checkpoint every X updates steps.
        train_batch_size (`int`, *optional*):
            The batch size for the training dataloader. Only needed when
            `auto_find_batch_size` has been used.
        num_input_tokens_seen (`int`, *optional*, defaults to 0):
            When tracking the inputs tokens, the number of tokens seen during training (number of input tokens, not the
            number of prediction tokens).
        total_flos (`float`, *optional*, defaults to 0):
            The total number of floating operations done by the model since the beginning of training (stored as floats
            to avoid overflow).
        log_history (`list[dict[str, float]]`, *optional*):
            The list of logs done since the beginning of training.
        best_metric (`float`, *optional*):
            When tracking the best model, the value of the best metric encountered so far.
        best_global_step (`int`, *optional*):
            When tracking the best model, the step at which the best metric was encountered.
            Used for setting `best_model_checkpoint`.
        best_model_checkpoint (`str`, *optional*):
            When tracking the best model, the value of the name of the checkpoint for the best model encountered so
            far.
        is_local_process_zero (`bool`, *optional*, defaults to `True`):
            Whether or not this process is the local (e.g., on one machine if training in a distributed fashion on
            several machines) main process.
        is_world_process_zero (`bool`, *optional*, defaults to `True`):
            Whether or not this process is the global main process (when training in a distributed fashion on several
            machines, this is only going to be `True` for one process).
        is_hyper_param_search (`bool`, *optional*, defaults to `False`):
            Whether we are in the process of a hyper parameter search using Trainer.hyperparameter_search. This will
            impact the way data will be logged in TensorBoard.
        stateful_callbacks (`list[StatefulTrainerCallback]`, *optional*):
            Callbacks attached to the `Trainer` that should have their states be saved or restored.
            Relevant callbacks should implement a `state` and `from_state` function.
    r   ÚepochÚglobal_stepÚ	max_stepsiô  Úlogging_stepsÚ
eval_stepsÚ
save_stepsNÚtrain_batch_sizeÚnum_train_epochsÚnum_input_tokens_seenÚ
total_flosÚlog_historyÚbest_metricÚbest_global_stepÚbest_model_checkpointTÚis_local_process_zeroÚis_world_process_zeroFÚis_hyper_param_searchÚ
trial_nameÚtrial_paramsÚTrainerCallbackÚstateful_callbacksc                 ó   — | j         €g | _         | j        €	i | _        d S t          | j        t          ¦  «        rd S i }| j        D ]²}t          |t          ¦  «        st          dt          |¦  «        › �¦  «        ‚|j        j        }||v rUt          ||         t          ¦  «        s||         g||<   ||          
                    |                     ¦   «         ¦  «         Œ›|                     ¦   «         ||<   Œ³|| _        d S )NzNAll callbacks passed to be saved must inherit `ExportableState`, but received )r   r!   Ú
isinstanceÚdictÚExportableStateÚ	TypeErrorÚtypeÚ	__class__Ú__name__ÚlistÚappendÚstate)Úselfr!   ÚcallbackÚnames       ú[/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/transformers/trainer_callback.pyÚ__post_init__zTrainerState.__post_init__t   s,  € ØÔÐ#Ø!ˆDÔØÔ"Ð*Ø&(ˆDÔ#Ð#Ð#Ý˜Ô/µÑ6Ô6ð 	9àˆDð "$ÐØ Ô3ð @ð @�Ý! (­_Ñ>Ô>ð Ý#ØyÕimÐnvÑiwÔiwÐyÐyñô ð ð  Ô)Ô2�ØÐ-Ð-Ð-õ &Ð&8¸Ô&>ÅÑEÔEð NØ4FÀtÔ4LÐ3MÐ*¨4Ñ0Ø& tÔ,×3Ò3°H·N²NÑ4DÔ4DÑEÔEÐEÐEà/7¯~ª~Ñ/?Ô/?Ð& tÑ,Ð,Ø&8ˆDÔ#Ð#Ð#ó    Ú	json_pathc                 óÞ   — t          j        t          j        | ¦  «        dd¬¦  «        dz   }t	          |dd¬¦  «        5 }|                     |¦  «         ddd¦  «         dS # 1 swxY w Y   dS )	zDSave the content of this instance in JSON format inside `json_path`.é   T)ÚindentÚ	sort_keysú
Úwúutf-8©ÚencodingN)ÚjsonÚdumpsÚdataclassesÚasdictÚopenÚwrite)r-   r3   Újson_stringÚfs       r0   Úsave_to_jsonzTrainerState.save_to_json�   s±   € å”j¥Ô!3°DÑ!9Ô!9À!ÈtÐTÑTÔTÐW[Ñ[ˆÝ�)˜S¨7Ð3Ñ3Ô3ð 	!°qØ�GŠG�KÑ Ô Ð ð	!ð 	!ð 	!ñ 	!ô 	!ð 	!ð 	!ð 	!ð 	!ð 	!ð 	!ð 	!øøøð 	!ð 	!ð 	!ð 	!ð 	!ð 	!s   ¿A"Á"A&Á)A&c                 ó°   — t          |d¬¦  «        5 }|                     ¦   «         }ddd¦  «         n# 1 swxY w Y    | di t          j        |¦  «        ¤ŽS )z3Create an instance from the content of `json_path`.r:   r;   N© )rA   Úreadr=   Úloads)Úclsr3   rD   Útexts       r0   Úload_from_jsonzTrainerState.load_from_json•   s–   € õ �) gÐ.Ñ.Ô.ð 	°!Ø—6’6‘8”8ˆDð	ð 	ð 	ñ 	ô 	ð 	ð 	ð 	ð 	ð 	ð 	øøøð 	ð 	ð 	ð 	àˆsÐ&Ð&•T”Z Ñ%Ô%Ð&Ð&Ð&s   ’3³7º7c                 óœ   — dD ]H}t          ||› d�¦  «        }|�1|dk     rt          j        ||z  ¦  «        }t          | |› d�|¦  «         ŒIdS )z”
        Calculates and stores the absolute value for logging,
        eval, and save steps based on if it was a proportion
        or not.
        )r
   ÚevalÚsaveÚ_stepsNr   )ÚgetattrÚmathÚceilÚsetattr)r-   Úargsr   Ú	step_kindÚ	num_stepss        r0   Úcompute_stepszTrainerState.compute_stepsœ   st   € ð 5ð 	?ð 	?ˆIÝ ¨Ð&:Ð&:Ð&:Ñ;Ô;ˆIØÐ$Ø˜q’=�=Ý $¤	¨)°iÑ*?Ñ @Ô @�IÝ˜ Ð2Ð2Ð2°IÑ>Ô>Ð>øð	?ð 	?r2   c                 ó  — |j         �&|j        �|                      |j        ¦  «        | _        d| _        |�ddlm}  ||¦  «        | _        || _        || _        |                     ¦   «         | _        | 	                    ¦   «         | _	        dS )zI
        Stores the initial training references needed in `self`
        Nr   )Ú	hp_params)
Úhp_nameÚ_trialr   r   Útransformers.integrationsrZ   r   r   r   r   )r-   Útrainerr   r   ÚtrialrZ   s         r0   Úinit_training_referencesz%TrainerState.init_training_references©   s™   € ð Œ?Ð&¨7¬>Ð+Eð &Ÿošo¨g¬nÑ=Ô=ˆDŒOØ ˆÔØÐØ;Ð;Ð;Ð;Ð;Ð;à ) 	¨%Ñ 0Ô 0ˆDÔà"ˆŒØ 0ˆÔØ%,×%BÒ%BÑ%DÔ%DˆÔ"Ø%,×%BÒ%BÑ%DÔ%DˆÔ"Ð"Ð"r2   )%r)   Ú
__module__Ú__qualname__Ú__doc__r   ÚfloatÚ__annotations__r   Úintr   r   r   r   r   r   r   r   r   r*   r$   Ústrr   r   r   r   Úboolr   r   r   r   r!   r1   rE   ÚclassmethodrL   rX   r`   rG   r2   r0   r   r   "   s*  € € € € € € ð9ð 9ðv €Eˆ5ÐÐÑØ€K�ÐÐÑØ€IˆsÐÐÑØ€M�3ÐÐÑØ€J�ÐÐÑØ€J�ÐÐÑØ#'Ð�c˜D‘jÐ'Ð'Ñ'ØÐ�cÐÐÑØ!"Ð˜3Ð"Ð"Ñ"Ø€J�ÐÐÑØ*.€K��d˜3 ˜:Ô&Ô'Ð.Ð.Ñ.Ø $€K�˜‘Ð$Ð$Ñ$Ø#'Ð�c˜D‘jÐ'Ð'Ñ'Ø(,Ð˜3 ™:Ð,Ð,Ñ,Ø"&Ð˜4Ð&Ð&Ñ&Ø"&Ð˜4Ð&Ð&Ñ&Ø"'Ð˜4Ð'Ð'Ñ'Ø!€J��d‘
Ð!Ð!Ñ!Ø?C€L�$�s˜C %™K¨#Ñ-°Ñ4Ð4Ô5¸Ñ<ÐCÐCÑCØ9=Ð˜Ð.Ô/°$Ñ6Ð=Ð=Ñ=ð9ð 9ð 9ð6! cð !ð !ð !ð !ð ð' sð 'ð 'ð 'ñ „[ð'ð?ð ?ð ?ðEð Eð Eð Eð Er2   r   c                   ó4   — e Zd ZdZdefd„Zed„ ¦   «         ZdS )r%   aj  
    A class for objects that include the ability to have its state
    be saved during `Trainer._save_checkpoint` and loaded back in during
    `Trainer._load_from_checkpoint`.

    These must implement a `state` function that gets called during the respective
    Trainer function call. It should only include parameters and attributes needed to
    recreate the state at a particular time, to avoid utilizing pickle/maintain standard
    file IO writing.

    Example:

    ```python
    class EarlyStoppingCallback(TrainerCallback, ExportableState):
        def __init__(self, early_stopping_patience: int = 1, early_stopping_threshold: Optional[float] = 0.0):
            self.early_stopping_patience = early_stopping_patience
            self.early_stopping_threshold = early_stopping_threshold
            # early_stopping_patience_counter denotes the number of times validation metrics failed to improve.
            self.early_stopping_patience_counter = 0

        def state(self) -> dict:
            return {
                "args": {
                    "early_stopping_patience": self.early_stopping_patience,
                    "early_stopping_threshold": self.early_stopping_threshold,
                },
                "attributes": {
                    "early_stopping_patience_counter": self.early_stopping_patience_counter,
                }
            }
    ```Úreturnc                 ó    — t          d¦  «        ‚)Nz<You must implement a `state` function to utilize this class.)ÚNotImplementedError©r-   s    r0   r,   zExportableState.stateÞ   s   € Ý!Ð"`ÑaÔaÐar2   c                 ó„   —  | di |d         ¤Ž}|d                               ¦   «         D ]\  }}t          |||¦  «         Œ|S )NrU   Ú
attributesrG   )ÚitemsrT   )rJ   r,   ÚinstanceÚkÚvs        r0   Ú
from_statezExportableState.from_stateá   sY   € à�3Ð'Ð'˜˜vœÐ'Ð'ˆØ˜,Ô'×-Ò-Ñ/Ô/ð 	$ð 	$‰DˆAˆqÝ�H˜a Ñ#Ô#Ð#Ð#Øˆr2   N)r)   ra   rb   rc   r$   r,   ri   ru   rG   r2   r0   r%   r%   ½   sZ   € € € € € ðð ð@b�tð bð bð bð bð ðð ñ „[ðð ð r2   r%   c                   óx   — e Zd ZU dZdZeed<   dZeed<   dZeed<   dZ	eed<   dZ
eed<   d„ Zd	„ Zd
„ Zdefd„ZdS )ÚTrainerControlaA  
    A class that handles the [`Trainer`] control flow. This class is used by the [`TrainerCallback`] to activate some
    switches in the training loop.

    Args:
        should_training_stop (`bool`, *optional*, defaults to `False`):
            Whether or not the training should be interrupted.

            If `True`, this variable will not be set back to `False`. The training will just stop.
        should_epoch_stop (`bool`, *optional*, defaults to `False`):
            Whether or not the current epoch should be interrupted.

            If `True`, this variable will be set back to `False` at the beginning of the next epoch.
        should_save (`bool`, *optional*, defaults to `False`):
            Whether or not the model should be saved at this step.

            If `True`, this variable will be set back to `False` at the beginning of the next step.
        should_evaluate (`bool`, *optional*, defaults to `False`):
            Whether or not the model should be evaluated at this step.

            If `True`, this variable will be set back to `False` at the beginning of the next step.
        should_log (`bool`, *optional*, defaults to `False`):
            Whether or not the logs should be reported at this step.

            If `True`, this variable will be set back to `False` at the beginning of the next step.
    FÚshould_training_stopÚshould_epoch_stopÚshould_saveÚshould_evaluateÚ
should_logc                 ó   — d| _         dS )z<Internal method that resets the variable for a new training.FN)rx   rn   s    r0   Ú_new_trainingzTrainerControl._new_training  s   € à$)ˆÔ!Ð!Ð!r2   c                 ó   — d| _         dS )z9Internal method that resets the variable for a new epoch.FN)ry   rn   s    r0   Ú
_new_epochzTrainerControl._new_epoch  s   € à!&ˆÔÐÐr2   c                 ó0   — d| _         d| _        d| _        dS )z8Internal method that resets the variable for a new step.FN)rz   r{   r|   rn   s    r0   Ú	_new_stepzTrainerControl._new_step  s   € à ˆÔØ$ˆÔØˆŒˆˆr2   rk   c                 óJ   — | j         | j        | j        | j        | j        dœi dœS )N©rx   ry   rz   r{   r|   ©rU   rp   r„   rn   s    r0   r,   zTrainerControl.state  s?   € ð )-Ô(AØ%)Ô%;Ø#Ô/Ø#'Ô#7Ø"œoðð ð ð	
ð 	
ð 		
r2   N)r)   ra   rb   rc   rx   rh   re   ry   rz   r{   r|   r~   r€   r‚   r$   r,   rG   r2   r0   rw   rw   é   s¼   € € € € € € ðð ð6 "'Ð˜$Ð&Ð&Ñ&Ø#Ð�tÐ#Ð#Ñ#Ø€K�ÐÐÑØ!€O�TÐ!Ð!Ñ!Ø€J�ÐÐÑð*ð *ð *ð'ð 'ð 'ð ð  ð  ð

�tð 

ð 

ð 

ð 

ð 

ð 

r2   rw   c                   óR  — e Zd ZdZdededefd„Zdededefd„Zdededefd„Z	dededefd„Z
dededefd	„Zdededefd
„Zdededefd„Zdededefd„Zdededefd„Zdededefd„Zdededefd„Zdededefd„Zdededefd„Zdededefd„Zdededefd„Zdededefd„ZdS )r    a0	  
    A class for objects that will inspect the state of the training loop at some events and take some decisions. At
    each of those events the following arguments are available:

    Args:
        args ([`TrainingArguments`]):
            The training arguments used to instantiate the [`Trainer`].
        state ([`TrainerState`]):
            The current state of the [`Trainer`].
        control ([`TrainerControl`]):
            The object that is returned to the [`Trainer`] and can be used to make some decisions.
        model ([`PreTrainedModel`] or `torch.nn.Module`):
            The model being trained.
        processing_class ([`PreTrainedTokenizer` or `BaseImageProcessor` or `ProcessorMixin` or `FeatureExtractionMixin`]):
            The processing class used for encoding the data. Can be a tokenizer, a processor, an image processor or a feature extractor.
        optimizer (`torch.optim.Optimizer`):
            The optimizer used for the training steps.
        lr_scheduler (`torch.optim.lr_scheduler.LambdaLR`):
            The scheduler used for setting the learning rate.
        train_dataloader (`torch.utils.data.DataLoader`, *optional*):
            The current dataloader used for training.
        eval_dataloader (`torch.utils.data.DataLoader`, *optional*):
            The current dataloader used for evaluation.
        metrics (`dict[str, float]`):
            The metrics computed by the last evaluation phase.

            Those are only accessible in the event `on_evaluate`.
        logs  (`dict[str, float]`):
            The values to log.

            Those are only accessible in the event `on_log`.

    The `control` object is the only one that can be changed by the callback, in which case the event that changes it
    should return the modified version.

    The argument `args`, `state` and `control` are positionals for all events, all the others are grouped in `kwargs`.
    You can unpack the ones you need in the signature of the event using them. As an example, see the code of the
    simple [`~transformers.PrinterCallback`].

    Example:

    ```python
    class PrinterCallback(TrainerCallback):
        def on_log(self, args, state, control, logs=None, **kwargs):
            _ = logs.pop("total_flos", None)
            if state.is_local_process_zero:
                print(logs)
    ```rU   r,   Úcontrolc                 ó   — dS )zS
        Event called at the end of the initialization of the [`Trainer`].
        NrG   ©r-   rU   r,   r‡   Úkwargss        r0   Úon_init_endzTrainerCallback.on_init_endZ  ó   € € € r2   c                 ó   — dS )z<
        Event called at the beginning of training.
        NrG   r‰   s        r0   Úon_train_beginzTrainerCallback.on_train_begin_  rŒ   r2   c                 ó   — dS )z6
        Event called at the end of training.
        NrG   r‰   s        r0   Úon_train_endzTrainerCallback.on_train_endd  rŒ   r2   c                 ó   — dS )z<
        Event called at the beginning of an epoch.
        NrG   r‰   s        r0   Úon_epoch_beginzTrainerCallback.on_epoch_begini  rŒ   r2   c                 ó   — dS )z6
        Event called at the end of an epoch.
        NrG   r‰   s        r0   Úon_epoch_endzTrainerCallback.on_epoch_endn  rŒ   r2   c                 ó   — dS )z˜
        Event called at the beginning of a training step. If using gradient accumulation, one training step might take
        several inputs.
        NrG   r‰   s        r0   Úon_step_beginzTrainerCallback.on_step_begins  rŒ   r2   c                 ó   — dS )zv
        Event called before the optimizer step but after gradient clipping. Useful for monitoring gradients.
        NrG   r‰   s        r0   Úon_pre_optimizer_stepz%TrainerCallback.on_pre_optimizer_stepy  rŒ   r2   c                 ó   — dS )z}
        Event called after the optimizer step but before gradients are zeroed out. Useful for monitoring gradients.
        NrG   r‰   s        r0   Úon_optimizer_stepz!TrainerCallback.on_optimizer_step~  rŒ   r2   c                 ó   — dS )zU
        Event called at the end of an substep during gradient accumulation.
        NrG   r‰   s        r0   Úon_substep_endzTrainerCallback.on_substep_endƒ  rŒ   r2   c                 ó   — dS )z’
        Event called at the end of a training step. If using gradient accumulation, one training step might take
        several inputs.
        NrG   r‰   s        r0   Úon_step_endzTrainerCallback.on_step_endˆ  rŒ   r2   c                 ó   — dS )z9
        Event called after an evaluation phase.
        NrG   r‰   s        r0   Úon_evaluatezTrainerCallback.on_evaluateŽ  rŒ   r2   c                 ó   — dS )z=
        Event called after a successful prediction.
        NrG   ©r-   rU   r,   r‡   ÚmetricsrŠ   s         r0   Ú
on_predictzTrainerCallback.on_predict“  rŒ   r2   c                 ó   — dS )z7
        Event called after a checkpoint save.
        NrG   r‰   s        r0   Úon_savezTrainerCallback.on_save˜  rŒ   r2   c                 ó   — dS )z;
        Event called after logging the last logs.
        NrG   r‰   s        r0   Úon_logzTrainerCallback.on_log�  rŒ   r2   c                 ó   — dS )z7
        Event called after a prediction step.
        NrG   r‰   s        r0   Úon_prediction_stepz"TrainerCallback.on_prediction_step¢  rŒ   r2   c                 ó   — dS )zŽ
        Event called before pushing the model to the hub, at the beginning of Trainer.push_to_hub and Trainer._push_from_checkpoint.
        NrG   r‰   s        r0   Úon_push_beginzTrainerCallback.on_push_begin§  rŒ   r2   N)r)   ra   rb   rc   r	   r   rw   r‹   rŽ   r�   r’   r”   r–   r˜   rš   rœ   rž   r    r¤   r¦   r¨   rª   r¬   rG   r2   r0   r    r    '  sÍ  € € € € € ð/ð /ðbÐ 1ð ¸,ð ÐQ_ð ð ð ð ð
Ð#4ð ¸\ð ÐTbð ð ð ð ð
Ð!2ð ¸<ð ÐR`ð ð ð ð ð
Ð#4ð ¸\ð ÐTbð ð ð ð ð
Ð!2ð ¸<ð ÐR`ð ð ð ð ð
Ð"3ð ¸Lð ÐSað ð ð ð ðÐ*;ð ÀLð Ð[ið ð ð ð ð
Ð&7ð Àð ÐWeð ð ð ð ð
Ð#4ð ¸\ð ÐTbð ð ð ð ð
Ð 1ð ¸,ð ÐQ_ð ð ð ð ðÐ 1ð ¸,ð ÐQ_ð ð ð ð ð
Ð0ð ¸ð ÐP^ð ð ð ð ð
Ð-ð °lð È^ð ð ð ð ð
Ð,ð °\ð ÈNð ð ð ð ð
Ð'8ð Àð ÐXfð ð ð ð ð
Ð"3ð ¸Lð ÐSað ð ð ð ð ð r2   r    c                   ó†  — e Zd ZdZd„ Zd„ Zd„ Zd„ Zed„ ¦   «         Z	de
ded	efd
„Zde
ded	efd„Zde
ded	efd„Zde
ded	efd„Zde
ded	efd„Zde
ded	efd„Zde
ded	efd„Zde
ded	efd„Zde
ded	efd„Zde
ded	efd„Zde
ded	efd„Zde
ded	efd„Zde
ded	efd„Zde
ded	efd„Zde
ded	efd„Zde
ded	efd„Zd„ ZdS )ÚCallbackHandlerz>Internal class that just calls the list of callbacks in order.c                 ó   — g | _         |D ]}|                      |¦  «         Œ|| _        || _        || _        || _        d | _        d | _        t          d„ | j         D ¦   «         ¦  «        s$t           
                    d| j        z   ¦  «         d S d S )Nc              3   ó@   K  — | ]}t          |t          ¦  «        V — Œd S ©N)r#   ÚDefaultFlowCallback©Ú.0Úcbs     r0   ú	<genexpr>z+CallbackHandler.__init__.<locals>.<genexpr>»  s-   è è € ÐPÐP¸2•:˜bÕ"5Ñ6Ô6ÐPÐPÐPÐPÐPÐPr2   zÔThe Trainer will not work properly if you don't have a `DefaultFlowCallback` in its callbacks. You
should add one before training with `trainer.add_callback(DefaultFlowCallback). The current list ofcallbacks is
:)Ú	callbacksÚadd_callbackÚmodelÚprocessing_classÚ	optimizerÚlr_schedulerÚtrain_dataloaderÚeval_dataloaderÚanyÚloggerÚwarningÚcallback_list)r-   r·   r¹   rº   r»   r¼   rµ   s          r0   Ú__init__zCallbackHandler.__init__°  sº   € ØˆŒØð 	"ð 	"ˆBØ×Ò˜bÑ!Ô!Ð!Ð!ØˆŒ
Ø 0ˆÔØ"ˆŒØ(ˆÔØ $ˆÔØ#ˆÔåÐPÐPÀÄÐPÑPÔPÑPÔPð 	Ý�NŠNð$ð Ô$ñ%ñô ð ð ð ð	ð 	r2   c                 ó0  — t          |t          ¦  «        r
 |¦   «         n|}t          |t          ¦  «        r|n|j        }|d„ | j        D ¦   «         v r)t                               d|› d�dz   | j        z   ¦  «         | j                             |¦  «         d S )Nc                 ó   — g | ]	}|j         ‘Œ
S rG   )r(   )r´   Úcs     r0   ú
<listcomp>z0CallbackHandler.add_callback.<locals>.<listcomp>Æ  s   € Ð<Ð<Ð<¨˜œÐ<Ð<Ð<r2   zYou are adding a zH to the callbacks of this Trainer, but there is already one. The currentzlist of callbacks is
:)r#   r'   r(   r·   rÀ   rÁ   rÂ   r+   )r-   r.   rµ   Úcb_classs       r0   r¸   zCallbackHandler.add_callbackÃ  s¬   € Ý% hµÑ5Ô5ÐCˆXˆX‰ZŒZˆZ¸8ˆÝ)¨(µDÑ9Ô9ÐQ�8�8¸xÔ?QˆØÐ<Ð<¨T¬^Ð<Ñ<Ô<Ð<Ð<Ý�NŠNØv HÐvÐvÐvØ+ñ,àÔ$ñ%ñô ð ð
 	Œ×Ò˜bÑ!Ô!Ð!Ð!Ð!r2   c                 ó   — t          |t          ¦  «        r:| j        D ]0}t          ||¦  «        r| j                             |¦  «         |c S Œ1d S | j        D ]&}||k    r| j                             |¦  «         |c S Œ'd S r±   ©r#   r'   r·   Úremove©r-   r.   rµ   s      r0   Úpop_callbackzCallbackHandler.pop_callbackÎ  s¯   € Ý�h¥Ñ%Ô%ð 		Ø”nð ð �Ý˜b (Ñ+Ô+ð Ø”N×)Ò)¨"Ñ-Ô-Ð-Ø�I�I�Iððð ð
 ”nð ð �Ø˜’>�>Ø”N×)Ò)¨"Ñ-Ô-Ð-Ø�I�I�Ið "ðð r2   c                 óÖ   — t          |t          ¦  «        r9| j        D ]/}t          ||¦  «        r| j                             |¦  «          d S Œ0d S | j                             |¦  «         d S r±   rÊ   rÌ   s      r0   Úremove_callbackzCallbackHandler.remove_callbackÚ  s�   € Ý�h¥Ñ%Ô%ð 	,Ø”nð ð �Ý˜b (Ñ+Ô+ð Ø”N×)Ò)¨"Ñ-Ô-Ð-Ø�F�Fððð ð
 ŒN×!Ò! (Ñ+Ô+Ð+Ð+Ð+r2   c                 óJ   — d                      d„ | j        D ¦   «         ¦  «        S )Nr8   c              3   ó.   K  — | ]}|j         j        V — Œd S r±   )r(   r)   r³   s     r0   r¶   z0CallbackHandler.callback_list.<locals>.<genexpr>å  s'   è è € ÐHÐH°2˜œÔ.ÐHÐHÐHÐHÐHÐHr2   )Újoinr·   rn   s    r0   rÂ   zCallbackHandler.callback_listã  s%   € à�yŠyÐHÐH¸¼ÐHÑHÔHÑHÔHÐHr2   rU   r,   r‡   c                 ó$   —  | j         d|||fi |¤ŽS )Nr‹   ©Ú
call_eventr‰   s        r0   r‹   zCallbackHandler.on_init_endç  ó"   € ØˆtŒ˜}¨d°E¸7ÐMÐMÀfÐMÐMÐMr2   c                 ó2   — d|_          | j        d|||fi |¤ŽS )NFrŽ   )rx   rÕ   r‰   s        r0   rŽ   zCallbackHandler.on_train_beginê  s+   € Ø',ˆÔ$ØˆtŒÐ/°°u¸gÐPÐPÈÐPÐPÐPr2   c                 ó$   —  | j         d|||fi |¤ŽS )Nr�   rÔ   r‰   s        r0   r�   zCallbackHandler.on_train_endî  ó"   € ØˆtŒ˜~¨t°U¸GÐNÐNÀvÐNÐNÐNr2   c                 ó2   — d|_          | j        d|||fi |¤ŽS )NFr’   )ry   rÕ   r‰   s        r0   r’   zCallbackHandler.on_epoch_beginñ  s+   € Ø$)ˆÔ!ØˆtŒÐ/°°u¸gÐPÐPÈÐPÐPÐPr2   c                 ó$   —  | j         d|||fi |¤ŽS )Nr”   rÔ   r‰   s        r0   r”   zCallbackHandler.on_epoch_endõ  rÙ   r2   c                 óN   — d|_         d|_        d|_         | j        d|||fi |¤ŽS )NFr–   )r|   r{   rz   rÕ   r‰   s        r0   r–   zCallbackHandler.on_step_beginø  s:   € Ø"ˆÔØ"'ˆÔØ#ˆÔØˆtŒ˜°°e¸WÐOÐOÈÐOÐOÐOr2   c                 ó$   —  | j         d|||fi |¤ŽS )Nr˜   rÔ   r‰   s        r0   r˜   z%CallbackHandler.on_pre_optimizer_stepþ  s$   € ØˆtŒÐ6¸¸eÀWÐWÐWÐPVÐWÐWÐWr2   c                 ó$   —  | j         d|||fi |¤ŽS )Nrš   rÔ   r‰   s        r0   rš   z!CallbackHandler.on_optimizer_step  s#   € ØˆtŒÐ2°D¸%ÀÐSÐSÈFÐSÐSÐSr2   c                 ó$   —  | j         d|||fi |¤ŽS )Nrœ   rÔ   r‰   s        r0   rœ   zCallbackHandler.on_substep_end  s#   € ØˆtŒÐ/°°u¸gÐPÐPÈÐPÐPÐPr2   c                 ó$   —  | j         d|||fi |¤ŽS )Nrž   rÔ   r‰   s        r0   rž   zCallbackHandler.on_step_end  rÖ   r2   c                 ó6   — d|_          | j        d|||fd|i|¤ŽS )NFr    r£   )r{   rÕ   r¢   s         r0   r    zCallbackHandler.on_evaluate
  s0   € Ø"'ˆÔØˆtŒ˜}¨d°E¸7Ð^Ð^ÈGÐ^ÐW]Ð^Ð^Ð^r2   c                 ó(   —  | j         d|||fd|i|¤ŽS )Nr¤   r£   rÔ   r¢   s         r0   r¤   zCallbackHandler.on_predict  s(   € ØˆtŒ˜|¨T°5¸'Ð]Ð]È7Ð]ÐV\Ð]Ð]Ð]r2   c                 ó2   — d|_          | j        d|||fi |¤ŽS )NFr¦   )rz   rÕ   r‰   s        r0   r¦   zCallbackHandler.on_save  s*   € Ø#ˆÔØˆtŒ˜y¨$°°wÐIÐIÀ&ÐIÐIÐIr2   c                 ó6   — d|_          | j        d|||fd|i|¤ŽS )NFr¨   Úlogs)r|   rÕ   )r-   rU   r,   r‡   rå   rŠ   s         r0   r¨   zCallbackHandler.on_log  s/   € Ø"ˆÔØˆtŒ˜x¨¨u°gÐSÐSÀDÐSÈFÐSÐSÐSr2   c                 ó$   —  | j         d|||fi |¤ŽS )Nrª   rÔ   r‰   s        r0   rª   z"CallbackHandler.on_prediction_step  s#   € ØˆtŒÐ3°T¸5À'ÐTÐTÈVÐTÐTÐTr2   c                 ó$   —  | j         d|||fi |¤ŽS )Nr¬   rÔ   r‰   s        r0   r¬   zCallbackHandler.on_push_begin  s"   € ØˆtŒ˜°°e¸WÐOÐOÈÐOÐOÐOr2   c                 óž   — | j         D ]D} t          ||¦  «        |||f| j        | j        | j        | j        | j        | j        dœ|¤Ž}|�|}ŒE|S )N)r¹   rº   r»   r¼   r½   r¾   )r·   rQ   r¹   rº   r»   r¼   r½   r¾   )r-   ÚeventrU   r,   r‡   rŠ   r.   Úresults           r0   rÕ   zCallbackHandler.call_event  s‚   € Øœð 	!ð 	!ˆHØ-•W˜X uÑ-Ô-ØØØðð ”jØ!%Ô!6Øœ.Ø!Ô.Ø!%Ô!6Ø $Ô 4ðð ð ðð ˆFð Ð!Ø �øØˆr2   N)r)   ra   rb   rc   rÃ   r¸   rÍ   rÏ   ÚpropertyrÂ   r	   r   rw   r‹   rŽ   r�   r’   r”   r–   r˜   rš   rœ   rž   r    r¤   r¦   r¨   rª   r¬   rÕ   rG   r2   r0   r®   r®   ­  s¡  € € € € € ØHÐHðð ð ð&	"ð 	"ð 	"ð
ð 
ð 
ð,ð ,ð ,ð ðIð Iñ „XðIðNÐ 1ð N¸,ð NÐQ_ð Nð Nð Nð NðQÐ#4ð Q¸\ð QÐTbð Qð Qð Qð QðOÐ!2ð O¸<ð OÐR`ð Oð Oð Oð OðQÐ#4ð Q¸\ð QÐTbð Qð Qð Qð QðOÐ!2ð O¸<ð OÐR`ð Oð Oð Oð OðPÐ"3ð P¸Lð PÐSað Pð Pð Pð PðXÐ*;ð XÀLð XÐ[ið Xð Xð Xð XðTÐ&7ð TÀð TÐWeð Tð Tð Tð TðQÐ#4ð Q¸\ð QÐTbð Qð Qð Qð QðNÐ 1ð N¸,ð NÐQ_ð Nð Nð Nð Nð_Ð 1ð _¸,ð _ÐQ_ð _ð _ð _ð _ð^Ð0ð ^¸ð ^ÐP^ð ^ð ^ð ^ð ^ðJÐ-ð J°lð JÈ^ð Jð Jð Jð JðTÐ,ð T°\ð TÈNð Tð Tð Tð TðUÐ'8ð UÀð UÐXfð Uð Uð Uð UðPÐ"3ð P¸Lð PÐSað Pð Pð Pð Pðð ð ð ð r2   r®   c                   ó:   — e Zd ZdZdededefd„Zdededefd„ZdS )r²   zx
    A [`TrainerCallback`] that handles the default flow of the training loop for logs, evaluation and checkpoints.
    rU   r,   r‡   c                 ól  — |j         dk    r|j        rd|_        |j        t          j        k    r|j         |j        z  dk    rd|_        |j        t          j        k    r*|j         |j        z  dk    r|j	        |j         k    rd|_
        |j        t          j        k    r%|j        dk    r|j         |j        z  dk    rd|_        |j         |j        k    rbd|_        |j        t          j        k    r*|j         |j        z  dk    r|j	        |j         k    rd|_
        |j        t          j        k    rd|_        |S )Nr   Tr   )r   Úlogging_first_stepr|   Úlogging_strategyr   ÚSTEPSr   Úeval_strategyr   Ú
eval_delayr{   Úsave_strategyr   r   rz   r   rx   r‰   s        r0   rž   zDefaultFlowCallback.on_step_end8  sL  € àÔ Ò!Ð! dÔ&=Ð!Ø!%ˆGÔØÔ Õ$4Ô$:Ò:Ð:¸uÔ?PÐSXÔSfÑ?fÐjkÒ?kÐ?kØ!%ˆGÔð ÔÕ"2Ô"8Ò8Ð8ØÔ! EÔ$4Ñ4¸Ò9Ð9Ø” 5Ô#4Ò4Ð4à&*ˆGÔ#ð Ô¥,Ô"4Ò4Ð4ØÔ  1Ò$Ð$ØÔ! EÔ$4Ñ4¸Ò9Ð9à"&ˆGÔð Ô ¤Ò/Ð/Ø+/ˆGÔ(ð Ô"Õ&6Ô&<Ò<Ð<ØÔ%¨Ô(8Ñ8¸AÒ=Ð=Ø”O uÔ'8Ò8Ð8à*.�Ô'àÔ!¥\Ô%7Ò7Ð7Ø&*�Ô#àˆr2   c                 óÎ   — |j         t          j        k    rd|_        |j        t          j        k    r|j        |j        k    rd|_        |j        t          j        k    rd|_
        |S )NT)rï   r   ÚEPOCHr|   rñ   rò   r   r{   ró   r   rz   r‰   s        r0   r”   z DefaultFlowCallback.on_epoch_end`  sf   € àÔ Õ$4Ô$:Ò:Ð:Ø!%ˆGÔð ÔÕ!1Ô!7Ò7Ð7¸D¼OÈuÌ{Ò<ZÐ<ZØ&*ˆGÔ#ð Ô¥Ô!3Ò3Ð3Ø"&ˆGÔàˆr2   N)	r)   ra   rb   rc   r	   r   rw   rž   r”   rG   r2   r0   r²   r²   3  su   € € € € € ðð ð&Ð 1ð &¸,ð &ÐQ_ð &ð &ð &ð &ðPÐ!2ð ¸<ð ÐR`ð ð ð ð ð ð r2   r²   c                   óN   — e Zd ZdZddefd„Zd„ Zd„ Zdd„Zd	„ Z	d
„ Z
dd„Zd„ ZdS )ÚProgressCallbackz®
    A [`TrainerCallback`] that displays the progress of training or evaluation.
    You can modify `max_str_len` to control how long strings are truncated when logging.
    éd   Úmax_str_lenc                 ó0   — d| _         d| _        || _        dS )a!  
        Initialize the callback with optional max_str_len parameter to control string truncation length.

        Args:
            max_str_len (`int`):
                Maximum length of strings to display in logs.
                Longer strings will be truncated with a message.
        N)Útraining_barÚprediction_barrù   )r-   rù   s     r0   rÃ   zProgressCallback.__init__v  s"   € ð !ˆÔØ"ˆÔØ&ˆÔÐÐr2   c                 óX   — |j         rt          |j        d¬¦  «        | _        d| _        d S )NT)ÚtotalÚdynamic_ncolsr   )r   r   r   rû   Úcurrent_stepr‰   s        r0   rŽ   zProgressCallback.on_train_beginƒ  s3   € ØÔ&ð 	PÝ $¨5¬?È$Ð OÑ OÔ OˆDÔØˆÔÐÐr2   c                 ó~   — |j         r5| j                             |j        | j        z
  ¦  «         |j        | _        d S d S r±   )r   rû   Úupdater   r   r‰   s        r0   rž   zProgressCallback.on_step_endˆ  sJ   € ØÔ&ð 	2ØÔ×$Ò$ UÔ%6¸Ô9JÑ%JÑKÔKÐKØ %Ô 1ˆDÔÐÐð	2ð 	2r2   Nc                 óÒ   — |j         r]t          |¦  «        rP| j        €+t          t	          |¦  «        | j        d u d¬¦  «        | _        | j                             d¦  «         d S d S d S )NT)rþ   Úleaverÿ   r   )r   r   rü   r   Úlenrû   r  )r-   rU   r,   r‡   r¾   rŠ   s         r0   rª   z#ProgressCallback.on_prediction_step�  s‡   € ØÔ&ð 	*­:°oÑ+FÔ+Fð 	*ØÔ"Ð*Ý&*Ý˜oÑ.Ô.°dÔ6GÈ4Ð6OÐ_cð'ñ 'ô '�Ô#ð Ô×&Ò& qÑ)Ô)Ð)Ð)Ð)ð	*ð 	*ð 	*ð 	*r2   c                 óf   — |j         r)| j        �| j                             ¦   «          d | _        d S d S r±   ©r   rü   Úcloser‰   s        r0   r    zProgressCallback.on_evaluate•  óC   € ØÔ&ð 	'ØÔ"Ð.ØÔ#×)Ò)Ñ+Ô+Ð+Ø"&ˆDÔÐÐð	'ð 	'r2   c                 óf   — |j         r)| j        �| j                             ¦   «          d | _        d S d S r±   r  r‰   s        r0   r¤   zProgressCallback.on_predict›  r	  r2   c                 ó¸  — |j         rÐ| j        �Ëi }|                     ¦   «         D ]s\  }}t          |t          ¦  «        r7t          |¦  «        | j        k    rdt          |¦  «        › d| j        › d�||<   ŒQt          |t          ¦  «        r|d›||<   Œn|||<   Œt|                     dd ¦  «        }	| j         	                    t	          |¦  «        ¦  «         d S d S d S )Nz%[String too long to display, length: z > z/. Consider increasing `max_str_len` if needed.]ú.4gr   )
r   rû   rq   r#   rg   r  rù   rd   ÚpoprB   )
r-   rU   r,   r‡   rå   rŠ   Úshallow_logsrs   rt   Ú_s
             r0   r¨   zProgressCallback.on_log¡  s  € ØÔ&ð 	7¨4Ô+<Ð+Hð ˆLØŸ
š
™œð 
(ð 
(‘��1Ý˜a¥Ñ%Ô%ð 	(­#¨a©&¬&°4Ô3CÒ*CÐ*CðHÅÀAÁÄð Hð HÈ4ÔK[ð Hð Hð Hð ! ‘O�Oõ   ¥5Ñ)Ô)ð (à)* j j�L ‘O�Oà&'�L ‘O�OØ× Ò  ¨tÑ4Ô4ˆAØÔ×#Ò#¥C¨Ñ$5Ô$5Ñ6Ô6Ð6Ð6Ð6ð!	7ð 	7Ð+HÐ+Hr2   c                 óX   — |j         r"| j                             ¦   «          d | _        d S d S r±   )r   rû   r  r‰   s        r0   r�   zProgressCallback.on_train_end´  s:   € ØÔ&ð 	%ØÔ×#Ò#Ñ%Ô%Ð%Ø $ˆDÔÐÐð	%ð 	%r2   )rø   r±   )r)   ra   rb   rc   rf   rÃ   rŽ   rž   rª   r    r¤   r¨   r�   rG   r2   r0   r÷   r÷   p  s±   € € € € € ðð ð
'ð ' Cð 'ð 'ð 'ð 'ðð ð ð
2ð 2ð 2ð
*ð *ð *ð *ð'ð 'ð 'ð'ð 'ð 'ð7ð 7ð 7ð 7ð&%ð %ð %ð %ð %r2   r÷   c                   ó   — e Zd ZdZdd„ZdS )ÚPrinterCallbackz?
    A bare [`TrainerCallback`] that just prints the logs.
    Nc                 ó¢   — |                      dd ¦  «        }|j        r1|�d„ |                     ¦   «         D ¦   «         }t          |¦  «         d S d S )Nr   c                 óL   — i | ]!\  }}|t          |t          ¦  «        r|d ›n|“Œ"S )r  )r#   rd   )r´   rs   rt   s      r0   ú
<dictcomp>z*PrinterCallback.on_log.<locals>.<dictcomp>Ã  s5   € Ð`Ð`Ð`É4È1Èa˜­*°Q½Ñ*>Ô*>ÐE˜q˜J˜J˜JÀAÐ`Ð`Ð`r2   )r  r   rq   Úprint)r-   rU   r,   r‡   rå   rŠ   r  s          r0   r¨   zPrinterCallback.on_log¿  s_   € Ø�HŠH�\ 4Ñ(Ô(ˆØÔ&ð 	ØÐØ`Ð`ÐSW×S]ÒS]ÑS_ÔS_Ð`Ñ`Ô`�Ý�$‰KŒKˆKˆKˆKð	ð 	r2   r±   )r)   ra   rb   rc   r¨   rG   r2   r0   r  r  º  s2   € € € € € ðð ðð ð ð ð ð r2   r  c                   óH   — e Zd ZdZddededz  fd„Zd„ Zd	„ Zd
„ Z	de
fd„ZdS )ÚEarlyStoppingCallbacka1  
    A [`TrainerCallback`] that handles early stopping.

    Args:
        early_stopping_patience (`int`):
            Use with `metric_for_best_model` to stop training when the specified metric worsens for
            `early_stopping_patience` evaluation calls.
        early_stopping_threshold(`float`, *optional*):
            Use with TrainingArguments `metric_for_best_model` and `early_stopping_patience` to denote how much the
            specified metric must improve to satisfy early stopping conditions. `

    This callback depends on [`TrainingArguments`] argument *load_best_model_at_end* functionality to set best_metric
    in [`TrainerState`]. Note that if the [`TrainingArguments`] argument *save_steps* differs from *eval_steps*, the
    early stopping will not occur until the next save step.
    r   ç        Úearly_stopping_patienceÚearly_stopping_thresholdNc                 ó0   — || _         || _        d| _        d S )Nr   ©r  r  Úearly_stopping_patience_counter)r-   r  r  s      r0   rÃ   zEarlyStoppingCallback.__init__Ø  s    € Ø'>ˆÔ$Ø(@ˆÔ%à/0ˆÔ,Ð,Ð,r2   c                 óæ   — |j         rt          j        nt          j        }|j        �1 |||j        ¦  «        r)t          ||j        z
  ¦  «        | j        k    r	d| _        d S | xj        dz  c_        d S )Nr   r   )Úgreater_is_betterÚnpÚgreaterÚlessr   Úabsr  r  )r-   rU   r,   r‡   Úmetric_valueÚoperators         r0   Úcheck_metric_valuez(EarlyStoppingCallback.check_metric_valueÞ  s}   € à!%Ô!7ÐD•2”:�:½R¼WˆØÔÐ$ØˆH�\ 5Ô#4Ñ5Ô5ð %å�L 5Ô#4Ñ4Ñ5Ô5¸Ô8UÒUÐUà34ˆDÔ0Ð0Ð0àÐ0Ô0°AÑ5Ð0Ô0Ð0Ð0r2   c                 ó¨   — |j         st                               d¦  «         |j        €
J d¦   «         ‚|j        t
          j        k    s
J d¦   «         ‚d S )NzŒUsing EarlyStoppingCallback without load_best_model_at_end=True. Once training is finished, the best model will not be loaded automatically.zBEarlyStoppingCallback requires metric_for_best_model to be definedzAEarlyStoppingCallback requires IntervalStrategy of steps or epoch)Úload_best_model_at_endrÀ   rÁ   Úmetric_for_best_modelrñ   r   ÚNOr‰   s        r0   rŽ   z$EarlyStoppingCallback.on_train_beginé  sp   € ØÔ*ð 	Ý�NŠNð^ñô ð ð Ô)Ð5Ð5ØPñ 6Ô5Ð5ð Ô!Õ%5Ô%8Ò8Ð8Ð8ØOñ 9Ô8Ð8Ð8Ð8r2   c                 ó  — |j         }|                     d¦  «        sd|› �}|                     |¦  «        }|€ t                               d|› d�¦  «         d S |                      ||||¦  «         | j        | j        k    r	d|_        d S d S )NÚeval_z@early stopping required metric_for_best_model, but did not find z so early stopping is disabledT)	r*  Ú
startswithÚgetrÀ   rÁ   r'  r  r  rx   )r-   rU   r,   r‡   r£   rŠ   Úmetric_to_checkr%  s           r0   r    z!EarlyStoppingCallback.on_evaluateö  sº   € ØÔ4ˆØ×)Ò)¨'Ñ2Ô2ð 	8Ø7 oÐ7Ð7ˆOØ—{’{ ?Ñ3Ô3ˆàÐÝ�NŠNðÐSbð ð ð ñô ð ð ˆFà×Ò  e¨W°lÑCÔCÐCØÔ/°4Ô3OÒOÐOØ+/ˆGÔ(Ð(Ð(ð PÐOr2   rk   c                 ó4   — | j         | j        dœd| j        idœS )N)r  r  r  r…   r  rn   s    r0   r,   zEarlyStoppingCallback.state  s8   € ð ,0Ô+GØ,0Ô,Iðð ð
 2°4Ô3Wðð
ð 
ð 	
r2   )r   r  )r)   ra   rb   rc   rf   rd   rÃ   r'  rŽ   r    r$   r,   rG   r2   r0   r  r  Ç  s”   € € € € € ðð ð 1ð 1°ð 1ÐSXÐ[_ÑS_ð 1ð 1ð 1ð 1ð	6ð 	6ð 	6ð
ð 
ð 
ð0ð 0ð 0ð"	
�tð 	
ð 	
ð 	
ð 	
ð 	
ð 	
r2   r  )rc   r?   r=   rR   r   Únumpyr!  Ú	tqdm.autor   Útrainer_utilsr   r   r   Útraining_argsr	   Úutilsr
   Ú
get_loggerr)   rÀ   r   r%   rw   r    r®   r²   r÷   r  r  rG   r2   r0   ú<module>r8     s†  ððð ð Ð Ð Ð Ø €€€Ø €€€Ø !Ð !Ð !Ð !Ð !Ð !à Ð Ð Ð Ø Ð Ð Ð Ð Ð à EÐ EÐ EÐ EÐ EÐ EÐ EÐ EÐ EÐ EØ ,Ð ,Ð ,Ð ,Ð ,Ð ,Ø Ð Ð Ð Ð Ð ð 
ˆÔ	˜HÑ	%Ô	%€ð ðWEð WEð WEð WEð WEñ WEô WEñ „ðWEðt)ð )ð )ð )ð )ñ )ô )ð )ðX ð:
ð :
ð :
ð :
ð :
�_ñ :
ô :
ñ „ð:
ðzCð Cð Cð Cð Cñ Cô Cð CðLCð Cð Cð Cð C�oñ Cô Cð CðL:ð :ð :ð :ð :˜/ñ :ô :ð :ðzG%ð G%ð G%ð G%ð G%�ñ G%ô G%ð G%ðT
ð 
ð 
ð 
ð 
�oñ 
ô 
ð 
ðI
ð I
ð I
ð I
ð I
˜O¨_ñ I
ô I
ð I
ð I
ð I
r2   