Ë
    S^(h½P  ã                   ó4  — d dl Z d dlZd dlmZ d dlmZ d dlmZmZm	Z	 d dl
Zd dlZd dlmZmZ d dlmZ ddlmZmZ dd	lmZ dd
lmZ  e j4                  e«      Z G d„ dej:                  j<                  «      Z G d„ dej:                  j<                  «      Z y)é    N)ÚPath)Úsleep)ÚCallableÚOptionalÚUnion)Ú
RepositoryÚcreate_repo)Úparseé   )ÚIntervalStrategyÚPreTrainedTokenizerBase)ÚTrainingSummary)Úkerasc                   óö   ‡ — e Zd ZdZ	 	 	 	 	 	 ddedeej                  j                  e	j                  ej                  eef   deee      deee      dee   deded	ee   fˆ fd
„Zedd„«       Zd„ Zdd„Zˆ xZS )ÚKerasMetricCallbacka[  
    Callback to compute metrics at the end of every epoch. Unlike normal Keras metrics, these do not need to be
    compilable by TF. It is particularly useful for common NLP metrics like BLEU and ROUGE that require string
    operations or generation loops that cannot be compiled. Predictions (or generations) will be computed on the
    `eval_dataset` before being passed to the `metric_fn` in `np.ndarray` format. The `metric_fn` should compute
    metrics and return a dict mapping metric names to metric values.

    We provide an example of a suitable metric_fn that computes ROUGE scores for a summarization model below. Note that
    this example skips some post-processing for readability and simplicity, and should probably not be used as-is!

    ```py
    from datasets import load_metric

    rouge_metric = load_metric("rouge")


    def rouge_fn(predictions, labels):
        decoded_predictions = tokenizer.batch_decode(predictions, skip_special_tokens=True)
        decoded_labels = tokenizer.batch_decode(labels, skip_special_tokens=True)
        result = rouge_metric.compute(predictions=decoded_predictions, references=decoded_labels)
        return {key: value.mid.fmeasure * 100 for key, value in result.items()}
    ```

    The above function will return a dict containing values which will be logged like any other Keras metric:

    ```
    {'rouge1': 37.4199, 'rouge2': 13.9768, 'rougeL': 34.361, 'rougeLsum': 35.0781
    ```

    Args:
        metric_fn (`Callable`):
            Metric function provided by the user. It will be called with two arguments - `predictions` and `labels`.
            These contain the model's outputs and matching labels from the dataset. It should return a dict mapping
            metric names to numerical values.
        eval_dataset (`tf.data.Dataset` or `dict` or `tuple` or `np.ndarray` or `tf.Tensor`):
            Validation data to be used to generate predictions for the `metric_fn`.
        output_cols (`List[str], *optional*):
            A list of columns to be retained from the model output as the predictions. Defaults to all.
        label_cols ('`List[str]`, *optional*'):
            A list of columns to be retained from the input dataset as the labels. Will be autodetected if this is not
            supplied.
        batch_size (`int`, *optional*):
            Batch size. Only used when the data is not a pre-batched `tf.data.Dataset`.
        predict_with_generate (`bool`, *optional*, defaults to `False`):
            Whether we should use `model.generate()` to get outputs for the model.
        use_xla_generation (`bool`, *optional*, defaults to `False`):
            If we're generating, whether to compile model generation with XLA. This can massively increase the speed of
            generation (up to 100X speedup) but will require a new XLA compilation for each input shape. When using XLA
            generation, it's a good idea to pad your inputs to the same size, or to use the `pad_to_multiple_of`
            argument in your `tokenizer` or `DataCollator`, which will reduce the number of unique input shapes and
            save a lot of compilation time. This option has no effect is `predict_with_generate` is `False`.
        generate_kwargs (`dict`, *optional*):
            Keyword arguments to pass to `model.generate()` when generating. Has no effect if `predict_with_generate`
            is `False`.

    Ú	metric_fnÚeval_datasetÚoutput_colsÚ
label_colsÚ
batch_sizeÚpredict_with_generateÚuse_xla_generationÚgenerate_kwargsc	                 óÀ  •— t         ‰| �  «        || _        || _        t	        |t
        j                  j                  «      sG|€t        d«      ‚t
        j                  j                  j                  |«      j                  |d¬«      }|| _        || _        || _        t	        |j                  t        «      r(t!        |j                  «      dk(  r|j                  \  }	}
n|j                  }	d }
|�)|D ]  }||	vsŒt        d|› d�«      ‚ || _        d| _        ns|
�d | _        d| _        nbd|	v r%dg| _        d| _        t'        j(                  d	«       n9d
|	v r*d|	v r&d
dg| _        d| _        t'        j(                  d«       nt        d«      ‚t+        t
        j,                  «      t+        d«      k  rt'        j(                  d«       || _        |€i n|| _        d | _        y )NzwWhen passing data to KerasMetricCallback that is not a pre-batched tf.data.Dataset the batch_size argument must be set.F)Údrop_remainderé   zLabel z? is in label_cols but could not be found in the dataset inputs!TÚlabelszTNo label_cols specified for KerasMetricCallback, assuming you want the 'labels' key.Ústart_positionsÚend_positionsznNo label_cols specified for KerasMetricCallback, assuming you want the start_positions and end_positions keys.zMCould not autodetect label_cols for KerasMetricCallback, please specify them!z2.7zHTF versions less than 2.7 may encounter issues with KerasMetricCallback!)ÚsuperÚ__init__r   r   Ú
isinstanceÚtfÚdataÚDatasetÚ
ValueErrorÚfrom_tensor_slicesÚbatchr   r   r   Úelement_specÚtupleÚlenr   Úuse_keras_labelÚloggingÚwarningr
   Ú__version__r   r   Úgeneration_function)Úselfr   r   r   r   r   r   r   r   Ú
input_specÚ
label_specÚlabelÚ	__class__s               €úZ/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/transformers/keras_callbacks.pyr!   zKerasMetricCallback.__init__N   sÖ  ø€ ô 	‰ÑÔØ"ˆŒØ$ˆŒÜ˜,¬¯©¯©Ô8ØÐ!Ü ð;óð ô
 Ÿ7™7Ÿ?™?×=Ñ=¸lÓK×QÑQÐR\ÐmrÐQÓsˆLØ(ˆÔØ%:ˆÔ"Ø&ˆÔô �l×/Ñ/´Ô7¼CÀ×@YÑ@YÓ<ZÐ^_Ò<_Ø%1×%>Ñ%>Ñ"ˆJ™
à%×2Ñ2ˆJØˆJØÐ!Ø#ò v�Ø 
Ò*Ü$ v¨e¨WÐ4sÐ%tÓuÐuðvð )ˆDŒOØ#(ˆDÕ ØÐ#ð #ˆDŒOØ#'ˆDÕ Ø˜Ñ#Ø'˜jˆDŒOØ#(ˆDÔ Ü�O‰OÐrÕsØ *Ñ,°ÀJÑ1NØ0°/ÐBˆDŒOØ#(ˆDÔ Ü�O‰Oð:õô
 ÐlÓmÐmÜ”—‘Ó ¤5¨£<Ò/Ü�O‰OÐfÔgà"4ˆÔØ%4Ð%<™rÀ/ˆÔà#'ˆÕ ó    c           
      ó  ‡ — ‰ d   j                   dk(  st        ˆ fd„‰ D «       «      rt        j                  ‰ d¬«      S t	        ‰ D �cg c]  }|j
                  d   ‘Œ c}«      }t        ‰ D �cg c]  }|j
                  d   ‘Œ c}«      }t        j                  ‰ d   |||gt        ‰ d   j
                  dd  «      z   ¬«      }d}‰ D ]4  }||||t        |«      z   …d |j
                  d   …f<   |t        |«      z  }Œ6 |S c c}w c c}w )Nr   r   c              3   ób   •K  — | ]&  }|j                   d    ‰d   j                   d    k(  –— Œ( y­w)r   r   N)Úshape)Ú.0r(   Úbatchess     €r6   ú	<genexpr>z;KerasMetricCallback._concatenate_batches.<locals>.<genexpr>’   s.   øè ø€ Ò&bÐQV u§{¡{°1¡~¸À¹×9IÑ9IÈ!Ñ9LÕ'LÑ&bùs   ƒ,/)Úaxisr   )Ú
fill_valuer:   )
ÚndimÚallÚnpÚconcatenateÚmaxr:   ÚsumÚ	full_likeÚlistr+   )r<   Úpadding_indexr(   Úmax_lenÚnum_samplesÚoutputÚis   `      r6   Ú_concatenate_batchesz(KerasMetricCallback._concatenate_batches�   s  ø€ ð �1‰:�?‰?˜aÒ¤3Ó&bÐZaÔ&bÔ#bÜ—>‘> '°Ô2Ð2ô °7Ö;¨%�u—{‘{ 1“~Ò;Ó<ˆÜ°wÖ?¨e˜5Ÿ;™; q›>Ò?Ó@ˆÜ—‘Ø�A‰J =¸ÀgÐ8NÔQUÐV]Ð^_ÑV`×VfÑVfÐghÐgiÐVjÓQkÑ8kô
ˆð ˆØò 	ˆEØ;@ˆF�1�qœ3˜u›:‘~Ð%Ð'7¨¯©°Q©Ð'7Ð7Ñ8Ø”�U“‰O‰Að	ð ˆùò <ùÚ?s   ÁDÁ.Dc                 ó  — t        |d   t        «      rki }|d   j                  «       D ]'  }| j                  |D �cg c]  }||   ‘Œ	 c}«      ||<   Œ) t	        |«      dk(  rt        |j                  «       «      d   }|S t        |d   t
        «      st        |d   t        «      rDg }t        |Ž D ]"  }|j                  | j                  |«      «       Œ$ t	        |«      dk(  r|d   }|S t        |d   t        j                  «      r| j                  |«      }|S t        |d   t        j                  «      r/| j                  |D �cg c]  }|j                  «       ‘Œ c}«      }|S t        dt!        |d   «      › d�«      ‚c c}w c c}w )Nr   r   zCouldn't handle batch of type ú!)r"   ÚdictÚkeysrM   r+   rG   Úvaluesr*   ÚzipÚappendrB   Úndarrayr#   ÚTensorÚnumpyÚ	TypeErrorÚtype)r1   ÚinputsÚoutputsÚkeyr(   Ú
input_listÚtensors          r6   Ú"_postprocess_predictions_or_labelsz6KerasMetricCallback._postprocess_predictions_or_labels¢   s}  € Ü�f˜Q‘i¤Ô&ØˆGØ˜a‘y—~‘~Ó'ò [�Ø#×8Ñ8ÐRXÖ9YÈ¸%À»*Ò9YÓZ�˜’ð[ô �7‹|˜qÒ Ü˜wŸ~™~Ó/Ó0°Ñ3�ð ˆô ˜˜q™	¤4Ô(¬J°v¸a±yÄ%Ô,HØˆGÜ! 6˜lò F�
Ø—‘˜t×8Ñ8¸ÓDÕEðFä�7‹|˜qÒ Ø! !™*�ð ˆô ˜˜q™	¤2§:¡:Ô.Ø×/Ñ/°Ó7ˆGð
 ˆô	 ˜˜q™	¤2§9¡9Ô-Ø×/Ñ/ÈfÖ0UÀF°·±µÒ0UÓVˆGð ˆô Ð<¼TÀ&ÈÁ)»_Ð<MÈQÐOÓPÐPùò :Zùò 1Vs   »F 
ÅFc                 ó”  ‡ — t        ‰ j                  d«      r"t        ‰ j                  j                  dg «      }ng }d }‰ j                  r§t        ‰ j                  d«      rAt        ‰ j                  j
                  d«      r!‰ j                  j
                  j                  }nt        ‰ j                  dd«      }‰ j                  r-‰ j                  €!ˆ fd„}t        j                  |d¬«      ‰ _        g }g }‰ j                  D �]E  }t        |t        «      r|\  }}	nd }	‰ j                  rvt        |t        «      r||   }
|j                  d	d «      }n|}
d }‰ j                  r‰ j                  |
|¬
«      }n¶ ‰ j                  j                   |
fd	|i‰ j"                  ¤Ž}nŒ‰ j                  j%                  |«      }t        |t        «      rat        |«      }‰ j&                  �‰ j&                  D �ci c]  }|||   “Œ
 }}n,|j)                  «       D ��ci c]  \  }}||dgz   vsŒ||“Œ }}}|j+                  |«       ‰ j,                  s,‰ j.                  D �ci c]  }|||   j1                  «       “Œ }	}nÂt        |	t        «      r2|	j)                  «       D ��ci c]  \  }}||j1                  «       “Œ }	}}n€t        |	t2        «      st        |	t        «      r|	D �cg c]  }|j1                  «       ‘Œ }	}nBt        |	t        j4                  «      r|	j1                  «       }	nt7        dt9        |	«      › �«      ‚|j+                  |	«       �ŒH ‰ j;                  |«      }‰ j;                  |«      }‰ j=                  ||f«      }t        |t        «      st7        d|› �«      ‚|j?                  |«       y c c}w c c}}w c c}w c c}}w c c}w )NÚconfigÚkeys_to_ignore_at_inferenceÚencoderÚmain_input_nameÚ	input_idsc                 óV   •—  ‰j                   j                  | fd|i‰j                  ¤ŽS )NÚattention_mask)ÚmodelÚgenerater   )rZ   rg   r1   s     €r6   r0   z=KerasMetricCallback.on_epoch_end.<locals>.generation_functionÉ   s+   ø€ Ø.˜4Ÿ:™:×.Ñ.¨vÑmÀnÐmÐX\×XlÑXlÑmÐmr7   T)Újit_compilerg   )rg   ÚlosszConfused by labels of type zSmetric_fn should return a dict mapping metric names to values but instead returned ) Úhasattrrh   Úgetattrra   r   rc   rd   r   r0   r#   Úfunctionr   r"   r*   rP   Úgetri   r   Úpredict_on_batchr   ÚitemsrT   r,   r   rW   rG   rV   rX   rY   r_   r   Úupdate)r1   ÚepochÚlogsÚignore_keysrd   r0   Úprediction_listÚ
label_listr(   r   Úgeneration_inputsrg   Úpredictionsr\   ÚvalÚarrayÚ	all_predsÚ
all_labelsÚmetric_outputs   `                  r6   Úon_epoch_endz KerasMetricCallback.on_epoch_end¸   st  ø€ Ü�4—:‘:˜xÔ(Ü! $§*¡*×"3Ñ"3Ð5RÐTVÓW‰KàˆKàˆØ×%Ò%ô �t—z‘z 9Ô-´'¸$¿*¹*×:LÑ:LÐN_Ô2`Ø"&§*¡*×"4Ñ"4×"DÑ"D‘ä")¨$¯*©*Ð6GÈÓ"U�à×&Ò&¨4×+CÑ+CÐ+Kônô ,.¯;©;Ð7JÐX\Ô+]�Ô(àˆØˆ
ð ×&Ñ&ó )	&ˆEÜ˜%¤Ô'Ø %‘�‘và�Ø×)Ò)Ü˜e¤TÔ*Ø(-¨oÑ(>Ð%Ø%*§Y¡YÐ/?ÀÓ%F‘Nà(-Ð%Ø%)�NØ×*Ò*Ø"&×":Ñ":Ð;LÐ]kÐ":Ó"l‘Kà"5 $§*¡*×"5Ñ"5Ø)ñ#Ø:Hð#ØLP×L`ÑL`ñ#‘Kð #Ÿj™j×9Ñ9¸%Ó@�Ü˜k¬4Ô0ô #' {Ó"3�KØ×'Ñ'Ð3ØHL×HXÑHXÖ&YÀ s¨K¸Ñ,<Ñ'<Ð&Y˜Ñ&Yð 6A×5FÑ5FÓ5H÷'Ù)1¨¨cÈCÐWbÐflÐemÑWmÒLm˜C ™Hð'˜ñ 'ð ×"Ñ" ;Ô/Ø×'Ò'Ø=A¿_¹_ÖM°c˜#˜u S™z×/Ñ/Ó1Ñ1ÐM�ÑMÜ˜F¤DÔ)Ø?E¿|¹|»~×N±°°e˜#˜uŸ{™{›}Ñ,ÐN�ÒNÜ˜F¤DÔ)¬Z¸ÄÔ-FØ5;Ö<¨E˜%Ÿ+™+�-Ð<�Ñ<Ü˜F¤B§I¡IÔ.ØŸ™›‘äÐ"=¼dÀ6»l¸^Ð LÓMÐMØ×Ñ˜fÖ%ðS)	&ðV ×;Ñ;¸OÓLˆ	Ø×<Ñ<¸ZÓHˆ
àŸ™¨	°:Ð'>Ó?ˆÜ˜-¬Ô.ÜØeÐfsÐetÐuóð ð 	�‰�MÕ"ùò= 'Zùó'ùò
 NùãNùâ<s$   Ç/N/ÈN4È#N4ÉN:ÊN?ËO)NNNFFN)iœÿÿÿ©N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r#   r$   r%   rB   rU   rV   r*   rP   r   rG   ÚstrÚintÚboolr!   ÚstaticmethodrM   r_   r   Ú__classcell__©r5   s   @r6   r   r      sÊ   ø„ ñ7ðz ,0Ø*.Ø$(Ø&+Ø#(Ø*.ñ?(àð?(ð ˜BŸG™GŸO™O¨R¯Z©Z¸¿¹ÀEÈ4ÐOÑPð?(ð ˜d 3™iÑ(ð	?(ð
 ˜T #™YÑ'ð?(ð ˜S‘Mð?(ð  $ð?(ð !ð?(ð " $™õ?(ðB òó ðò$÷,Q#r7   r   c                   óš   ‡ — e Zd ZdZ	 	 	 	 	 	 ddeeef   deeef   dee	   dee
   dee   dee   defˆ fd	„Zdd
„Zdd„Zdd„Zdd„Zˆ xZS )ÚPushToHubCallbackaK	  
    Callback that will save and push the model to the Hub regularly. By default, it pushes once per epoch, but this can
    be changed with the `save_strategy` argument. Pushed models can be accessed like any other model on the hub, such
    as with the `from_pretrained` method.

    ```py
    from transformers.keras_callbacks import PushToHubCallback

    push_to_hub_callback = PushToHubCallback(
        output_dir="./model_save",
        tokenizer=tokenizer,
        hub_model_id="gpt5-7xlarge",
    )

    model.fit(train_dataset, callbacks=[push_to_hub_callback])
    ```

    Args:
        output_dir (`str`):
            The output directory where the model predictions and checkpoints will be written and synced with the
            repository on the Hub.
        save_strategy (`str` or [`~trainer_utils.IntervalStrategy`], *optional*, defaults to `"epoch"`):
            The checkpoint save strategy to adopt during training. Possible values are:

                - `"no"`: Save is done at the end of training.
                - `"epoch"`: Save is done at the end of each epoch.
                - `"steps"`: Save is done every `save_steps`
        save_steps (`int`, *optional*):
            The number of steps between saves when using the "steps" `save_strategy`.
        tokenizer (`PreTrainedTokenizerBase`, *optional*):
            The tokenizer used by the model. If supplied, will be uploaded to the repo alongside the weights.
        hub_model_id (`str`, *optional*):
            The name of the repository to keep in sync with the local `output_dir`. It can be a simple model ID in
            which case the model will be pushed in your namespace. Otherwise it should be the whole repository name,
            for instance `"user_name/model"`, which allows you to push to an organization you are a member of with
            `"organization_name/model"`.

            Will default to the name of `output_dir`.
        hub_token (`str`, *optional*):
            The token to use to push the model to the Hub. Will default to the token in the cache folder obtained with
            `huggingface-cli login`.
        checkpoint (`bool`, *optional*, defaults to `False`):
            Whether to save full training checkpoints (including epoch and optimizer state) to allow training to be
            resumed. Only usable when `save_strategy` is `"epoch"`.
    Ú
output_dirÚsave_strategyÚ
save_stepsÚ	tokenizerÚhub_model_idÚ	hub_tokenÚ
checkpointc                 ój  •— t         ‰	| �  «        |r|dk7  rt        d«      ‚t        |t        «      rt        |j                  «       «      }|| _        | j                  t
        j                  k(  r t        |t        «      r|dk  rt        d«      ‚|| _
        t        |«      }|€|j                  «       j                  }t        |d|¬«      j                  | _        || _        t%        t	        | j"                  «      | j                   |¬«      | _        || _        d | _        || _        d | _        || _        y )Nrs   z:Cannot save checkpoints when save_strategy is not 'epoch'!r   zWPlease supply a positive integer argument for save_steps when save_strategy == 'steps'!T)Úrepo_idÚexist_okÚtoken)Ú
clone_fromr—   )r    r!   r&   r"   r…   r   ÚlowerrŽ   ÚSTEPSr†   r�   r   ÚabsoluteÚnamer	   r•   r‘   r�   r   Úrepor�   Úlast_jobr“   Útraining_historyÚmodel_card_args)
r1   r�   rŽ   r�   r�   r‘   r’   r“   r    r5   s
            €r6   r!   zPushToHubCallback.__init__;  s  ø€ ô 	‰ÑÔÙ˜-¨7Ò2ÜÐYÓZÐZÜ�m¤SÔ)Ü,¨]×-@Ñ-@Ó-BÓCˆMØ*ˆÔØ×ÑÔ!1×!7Ñ!7Ò7ÄÈJÔX[ÔA\Ð`jÐnoÒ`oÜÐvÓwÐwØ$ˆŒÜ˜*Ó%ˆ
ð ÐØ%×.Ñ.Ó0×5Ñ5ˆLÜ'°ÀtÐS\Ô]×eÑeˆÔà$ˆŒÜœs 4§?¡?Ó3À×@QÑ@QÐYbÔcˆŒ	à"ˆŒØˆŒØ$ˆŒØ $ˆÔØ.ˆÕr7   c                 ó   — g | _         y r€   )rŸ   )r1   rt   s     r6   Úon_train_beginz PushToHubCallback.on_train_begin_  s   € ð !#ˆÕr7   c                 ó®  — | j                   t        j                  k(  r¸|dz   | j                  z  dk(  r¢| j                  �| j                  j
                  sy | j                  j                  | j                  «       | j                  �%| j                  j                  | j                  «       | j                  j                  d|› �d¬«      \  }| _        y y y )Nr   r   zTraining in progress steps F©Úcommit_messageÚblocking)rŽ   r   rš   r�   rž   Úis_donerh   Úsave_pretrainedr�   r�   r�   Úpush_to_hub)r1   r(   rt   Ú_s       r6   Úon_train_batch_endz$PushToHubCallback.on_train_batch_endd  s°   € Ø×ÑÔ!1×!7Ñ!7Ò7¸UÀQ¹YÈ$Ï/É/Ñ<YÐ]^Ò<^Ø�}‰}Ð(°·±×1FÒ1FØØ�J‰J×&Ñ& t§¡Ô7Ø�~‰~Ð)Ø—‘×.Ñ.¨t¯©Ô?Ø#Ÿy™y×4Ñ4Ø!<¸U¸GÐDÈuð  5ó  ÑˆAˆt�}ð =_Ð7r7   c                 óº  — |j                  «       }d|vr||d<   | j                  j                  |«       | j                  t        j
                  k(  �r}| j                  �| j                  j                  sy | j                  j                  | j                  «       | j                  �%| j                  j                  | j                  «       | j                  rFt        j                  j                  | j                  d«      }| j                  j!                  ||«       t#        j$                  d	| j                  | j&                  | j                  dœ| j(                  ¤Ž}|j+                  «       }| j                  dz  j-                  d«      5 }|j/                  |«       d d d «       | j0                  j3                  d|› �d¬«      \  }| _        y y # 1 sw Y   Œ3xY w)
Nrs   r“   ©rh   Ú
model_nameÚkeras_historyú	README.mdÚwzTraining in progress epoch Fr¤   © )ÚcopyrŸ   rT   rŽ   r   ÚEPOCHrž   r§   rh   r¨   r�   r�   r“   ÚosÚpathÚjoinÚ_save_checkpointr   Ú
from_kerasr‘   r    Úto_model_cardÚopenÚwriter�   r©   )r1   rs   rt   Úcheckpoint_dirÚtrain_summaryÚ
model_cardÚfrª   s           r6   r   zPushToHubCallback.on_epoch_endo  s‚  € Ø�y‰y‹{ˆØ˜$ÑØ!ˆD�‰MØ×Ñ×$Ñ$ TÔ*Ø×ÑÔ!1×!7Ñ!7Ó7Ø�}‰}Ð(°·±×1FÒ1FØØ�J‰J×&Ñ& t§¡Ô7Ø�~‰~Ð)Ø—‘×.Ñ.¨t¯©Ô?Ø�ŠÜ!#§¡§¡¨d¯o©o¸|Ó!L�Ø—
‘
×+Ñ+¨N¸EÔBÜ+×6Ñ6ð Ø—j‘jØ×,Ñ,Ø"×3Ñ3ñð ×&Ñ&ñ	ˆMð '×4Ñ4Ó6ˆJØ—/‘/ KÑ/×5Ñ5°cÓ:ð $¸aØ—‘˜
Ô#÷$à#Ÿy™y×4Ñ4Ø!<¸U¸GÐDÈuð  5ó  ÑˆAˆt�}ð% 8÷ $ð $ús   ÆGÇGc                 óö  — | j                   �e| j                   j                  sOt        j                  d«       | j                   j                  s#t	        d«       | j                   j                  sŒ"y y | j
                  j                  | j                  «       | j                  �%| j                  j                  | j                  «       t        j                  d	| j
                  | j                  | j                  dœ| j                  ¤Ž}|j                  «       }| j                  dz  j                  d«      5 }|j!                  |«       d d d «       | j"                  j%                  dd¬«       y # 1 sw Y   Œ'xY w)
Nz;Pushing the last epoch to the Hub, this may take a while...r   r­   r°   r±   zEnd of trainingTr¤   r²   )rž   r§   r-   Úinfor   rh   r¨   r�   r�   r   r¹   r‘   rŸ   r    rº   r»   r¼   r�   r©   )r1   rt   r¾   r¿   rÀ   s        r6   Úon_train_endzPushToHubCallback.on_train_endŠ  s   € à�=‰=Ð$¨T¯]©]×-BÒ-BÜ�L‰LÐVÔWØ—m‘m×+Ò+Ü�a”ð —m‘m×+Õ+ð �J‰J×&Ñ& t§¡Ô7Ø�~‰~Ð)Ø—‘×.Ñ.¨t¯©Ô?Ü+×6Ñ6ð Ø—j‘jØ×,Ñ,Ø"×3Ñ3ñð ×&Ñ&ñ	ˆMð '×4Ñ4Ó6ˆJØ—/‘/ KÑ/×5Ñ5°cÓ:ð $¸aØ—‘˜
Ô#÷$à�I‰I×!Ñ!Ð1BÈTÐ!ÕR÷$ð $ús   Ä7E/Å/E8)rs   NNNNFr€   )r�   r‚   rƒ   r„   r   r…   r   r   r   r†   r   r‡   r!   r¢   r«   r   rÃ   r‰   rŠ   s   @r6   rŒ   rŒ     s¢   ø„ ñ,ðb 7>Ø$(Ø7;Ø&*Ø#'Ø ñ"/à˜#˜t˜)Ñ$ð"/ð ˜SÐ"2Ð2Ñ3ð"/ð ˜S‘Mð	"/ð
 Ð3Ñ4ð"/ð ˜s‘mð"/ð ˜C‘=ð"/ð õ"/óH#ó
	ó÷6Sr7   rŒ   )!r-   rµ   Úpathlibr   Útimer   Útypingr   r   r   rW   rB   Ú
tensorflowr#   Úhuggingface_hubr   r	   Úpackaging.versionr
   Ú r   r   Ú	modelcardr   Úmodeling_tf_utilsr   Ú	getLoggerr�   ÚloggerÚ	callbacksÚCallbackr   rŒ   r²   r7   r6   ú<module>rÑ      ss   ðÛ Û 	Ý Ý ß ,Ñ ,ã Û ß 3Ý #ç 7Ý &Ý $ð 
ˆ×	Ñ	˜8Ó	$€ôu#˜%Ÿ/™/×2Ñ2ô u#ôpQS˜Ÿ™×0Ñ0õ QSr7   