





'''simple docstring'''


from __future__ import annotations

import unittest

from transformers import EsmConfig, is_tf_available
from transformers.testing_utils import require_tf, slow

from ...test_configuration_common import ConfigTester
from ...test_modeling_tf_common import TFModelTesterMixin, floats_tensor, ids_tensor, random_attention_mask
from ...test_pipeline_mixin import PipelineTesterMixin


if is_tf_available():
       import numpy
       import tensorflow as tf

       from transformers.models.esm.modeling_tf_esm import (
           TF_ESM_PRETRAINED_MODEL_ARCHIVE_LIST,
           TFEsmForMaskedLM,
           TFEsmForSequenceClassification,
           TFEsmForTokenClassification,
           TFEsmModel,
       )

class  lowerCAmelCase_		:




 def __init__(						self      ,  _lowerCAmelCase      ,  )     ->				Optional[Any]:
     _lowerCAmelCase						      =   parent
     _lowerCAmelCase						      =   13
     _lowerCAmelCase						      =   7
     _lowerCAmelCase						      =   True
     _lowerCAmelCase						      =   True
     _lowerCAmelCase						      =   True
     _lowerCAmelCase						      =   99
     _lowerCAmelCase						      =   32
     _lowerCAmelCase						      =   2
     _lowerCAmelCase						      =   4
     _lowerCAmelCase						      =   37
     _lowerCAmelCase						      =   "gelu"
     _lowerCAmelCase						      =   0.1
     _lowerCAmelCase						      =   0.1
     _lowerCAmelCase						      =   512
     _lowerCAmelCase						      =   16
     _lowerCAmelCase						      =   2
     _lowerCAmelCase						      =   0.02
     _lowerCAmelCase						      =   3
     _lowerCAmelCase						      =   4
     _lowerCAmelCase						      =   None




 def 				_snake_case (						self		)     ->				Dict:
     _lowerCAmelCase						      =   ids_tensor([self.batch_size, self.seq_length]      ,  self.vocab_size		)

     _lowerCAmelCase						      =   None
     if self.use_input_mask:
         _lowerCAmelCase						      =   random_attention_mask([self.batch_size, self.seq_length]		)

     _lowerCAmelCase						      =   None
     _lowerCAmelCase						      =   None
     _lowerCAmelCase						      =   None
     if self.use_labels:
         _lowerCAmelCase						      =   ids_tensor([self.batch_size]      ,  self.type_sequence_label_size		)
         _lowerCAmelCase						      =   ids_tensor([self.batch_size, self.seq_length]      ,  self.num_labels		)
         _lowerCAmelCase						      =   ids_tensor([self.batch_size]      ,  self.num_choices		)

     _lowerCAmelCase						      =   EsmConfig(
         vocab_size=self.vocab_size      ,  hidden_size=self.hidden_size      ,  num_hidden_layers=self.num_hidden_layers      ,  pad_token_id=1      ,  num_attention_heads=self.num_attention_heads      ,  intermediate_size=self.intermediate_size      ,  hidden_act=self.hidden_act      ,  hidden_dropout_prob=self.hidden_dropout_prob      ,  attention_probs_dropout_prob=self.attention_probs_dropout_prob      ,  max_position_embeddings=self.max_position_embeddings      ,  type_vocab_size=self.type_vocab_size      ,  initializer_range=self.initializer_range      ,  )

     return config, input_ids, input_mask, sequence_labels, token_labels, choice_labels




 def 				_snake_case (						self		)     ->				str:
     (
         (
         _lowerCAmelCase
     )      ,      (
         _lowerCAmelCase
     )      ,      (
         _lowerCAmelCase
     )      ,      (
         _lowerCAmelCase
     )      ,      (
         _lowerCAmelCase
     )      ,      (
         _lowerCAmelCase
     )      ,      
     )						      =   self.prepare_config_and_inputs()

     _lowerCAmelCase						      =   True
     _lowerCAmelCase						      =   floats_tensor([self.batch_size, self.seq_length, self.hidden_size]		)
     _lowerCAmelCase						      =   ids_tensor([self.batch_size, self.seq_length]      ,  vocab_size=2		)

     return (
         config,
         input_ids,
         input_mask,
         sequence_labels,
         token_labels,
         choice_labels,
         encoder_hidden_states,
         encoder_attention_mask,
     )




 def 				_snake_case (						self      ,  _lowerCAmelCase      ,  _lowerCAmelCase      ,  _lowerCAmelCase      ,  _lowerCAmelCase      ,  _lowerCAmelCase      ,  _lowerCAmelCase		)     ->				Any:
     _lowerCAmelCase						      =   TFEsmModel(config=_lowerCAmelCase		)
     _lowerCAmelCase						      =   {"input_ids": input_ids, "attention_mask": input_mask}
     _lowerCAmelCase						      =   model(_lowerCAmelCase		)

     _lowerCAmelCase						      =   [input_ids, input_mask]
     _lowerCAmelCase						      =   model(_lowerCAmelCase		)

     _lowerCAmelCase						      =   model(_lowerCAmelCase		)

     self.parent.assertEqual(result.last_hidden_state.shape      ,  (self.batch_size, self.seq_length, self.hidden_size)		)




 def 				_snake_case (						self      ,  _lowerCAmelCase      ,  _lowerCAmelCase      ,  _lowerCAmelCase      ,  _lowerCAmelCase      ,  _lowerCAmelCase      ,  _lowerCAmelCase      ,  _lowerCAmelCase      ,  _lowerCAmelCase      ,  )     ->				Union[str, Any]:
     _lowerCAmelCase						      =   True

     _lowerCAmelCase						      =   TFEsmModel(config=_lowerCAmelCase		)
     _lowerCAmelCase						      =   {
         "input_ids": input_ids,
         "attention_mask": input_mask,
         "encoder_hidden_states": encoder_hidden_states,
         "encoder_attention_mask": encoder_attention_mask,
     }
     _lowerCAmelCase						      =   model(_lowerCAmelCase		)

     _lowerCAmelCase						      =   [input_ids, input_mask]
     _lowerCAmelCase						      =   model(_lowerCAmelCase      ,  encoder_hidden_states=_lowerCAmelCase		)

     # Also check the case where encoder outputs are not passed
     _lowerCAmelCase						      =   model(_lowerCAmelCase      ,  attention_mask=_lowerCAmelCase		)

     self.parent.assertEqual(result.last_hidden_state.shape      ,  (self.batch_size, self.seq_length, self.hidden_size)		)




 def 				_snake_case (						self      ,  _lowerCAmelCase      ,  _lowerCAmelCase      ,  _lowerCAmelCase      ,  _lowerCAmelCase      ,  _lowerCAmelCase      ,  _lowerCAmelCase		)     ->				List[str]:
     _lowerCAmelCase						      =   TFEsmForMaskedLM(config=_lowerCAmelCase		)
     _lowerCAmelCase						      =   model([input_ids, input_mask]		)
     self.parent.assertEqual(result.logits.shape      ,  (self.batch_size, self.seq_length, self.vocab_size)		)




 def 				_snake_case (						self      ,  _lowerCAmelCase      ,  _lowerCAmelCase      ,  _lowerCAmelCase      ,  _lowerCAmelCase      ,  _lowerCAmelCase      ,  _lowerCAmelCase		)     ->				str:
     _lowerCAmelCase						      =   self.num_labels
     _lowerCAmelCase						      =   TFEsmForTokenClassification(config=_lowerCAmelCase		)
     _lowerCAmelCase						      =   {"input_ids": input_ids, "attention_mask": input_mask}
     _lowerCAmelCase						      =   model(_lowerCAmelCase		)
     self.parent.assertEqual(result.logits.shape      ,  (self.batch_size, self.seq_length, self.num_labels)		)





 def 				_snake_case (						self		)     ->				List[str]:
     _lowerCAmelCase						      =   self.prepare_config_and_inputs()
     (
         (
         _lowerCAmelCase
     )      ,      (
         _lowerCAmelCase
     )      ,      (
         _lowerCAmelCase
     )      ,      (
         _lowerCAmelCase
     )      ,      (
         _lowerCAmelCase
     )      ,      (
         _lowerCAmelCase
     )      ,      
     )						      =   config_and_inputs
     _lowerCAmelCase						      =   {"input_ids": input_ids, "attention_mask": input_mask}
     return config, inputs_dict







@require_tf
class  lowerCAmelCase_		(		__magic_name__    ,__magic_name__    ,unittest.TestCase		):
 __lowerCamelCase    :				Tuple								=       (
     (
         TFEsmModel,
         TFEsmForMaskedLM,
         TFEsmForSequenceClassification,
         TFEsmForTokenClassification,
     )
     if is_tf_available()
     else ()
 )
 __lowerCamelCase    :				Any								=       (
     {
         "feature-extraction": TFEsmModel,
         "fill-mask": TFEsmForMaskedLM,
         "text-classification": TFEsmForSequenceClassification,
         "token-classification": TFEsmForTokenClassification,
         "zero-shot": TFEsmForSequenceClassification,
     }
     if is_tf_available()
     else {}
 )
 __lowerCamelCase    :				List[Any]								=       False
 __lowerCamelCase    :				int								=       False




 def 				_snake_case (						self		)     ->				List[Any]:
     _lowerCAmelCase						      =   TFEsmModelTester(self		)
     _lowerCAmelCase						      =   ConfigTester(self      ,  config_class=_lowerCAmelCase      ,  hidden_size=37		)




 def 				_snake_case (						self		)     ->				List[str]:
     self.config_tester.run_common_tests()




 def 				_snake_case (						self		)     ->				int:
     _lowerCAmelCase						      =   self.model_tester.prepare_config_and_inputs()
     self.model_tester.create_and_check_model(*_lowerCAmelCase		)




 def 				_snake_case (						self		)     ->				int:
     _lowerCAmelCase						      =   self.model_tester.prepare_config_and_inputs_for_decoder()
     self.model_tester.create_and_check_model_as_decoder(*_lowerCAmelCase		)




 def 				_snake_case (						self		)     ->				int:
     _lowerCAmelCase						      =   self.model_tester.prepare_config_and_inputs()
     self.model_tester.create_and_check_for_masked_lm(*_lowerCAmelCase		)




 def 				_snake_case (						self		)     ->				Union[str, Any]:
     _lowerCAmelCase						      =   self.model_tester.prepare_config_and_inputs()
     self.model_tester.create_and_check_for_token_classification(*_lowerCAmelCase		)




 @slow
 def 				_snake_case (						self		)     ->				Optional[int]:
     for model_name in TF_ESM_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
         _lowerCAmelCase						      =   TFEsmModel.from_pretrained(_lowerCAmelCase		)
         self.assertIsNotNone(_lowerCAmelCase		)




 @unittest.skip("Protein models do not support embedding resizing."		)
 def 				_snake_case (						self		)     ->				Dict:
     pass




 @unittest.skip("Protein models do not support embedding resizing."		)
 def 				_snake_case (						self		)     ->				Dict:
     pass





 def 				_snake_case (						self		)     ->				Tuple:
     _lowerCAmelCase      ,      _lowerCAmelCase						      =   self.model_tester.prepare_config_and_inputs_for_common()

     for model_class in self.all_model_classes:
         _lowerCAmelCase						      =   model_class(_lowerCAmelCase		)
         assert isinstance(model.get_input_embeddings()      ,  tf.keras.layers.Layer		)
         if model_class is TFEsmForMaskedLM:
             # Output embedding test differs from the main test because they're a matrix, not a layer
             _lowerCAmelCase						      =   model.get_bias()
             assert isinstance(_lowerCAmelCase      ,  _lowerCAmelCase		)
             for k, v in name.items():
                 assert isinstance(_lowerCAmelCase      ,  tf.Variable		)
         else:
             _lowerCAmelCase						      =   model.get_output_embeddings()
             assert x is None
             _lowerCAmelCase						      =   model.get_bias()
             assert name is None







@require_tf
class  lowerCAmelCase_		(		unittest.TestCase		):




 @slow
 def 				_snake_case (						self		)     ->				Optional[int]:
     _lowerCAmelCase						      =   TFEsmForMaskedLM.from_pretrained("facebook/esm2_t6_8M_UR50D"		)

     _lowerCAmelCase						      =   tf.constant([[0, 1, 2, 3, 4, 5]]		)
     _lowerCAmelCase						      =   model(_lowerCAmelCase		)[0]
     _lowerCAmelCase						      =   [1, 6, 33]
     self.assertEqual(list(output.numpy().shape		)      ,  _lowerCAmelCase		)
     # compare the actual values for a slice.
     _lowerCAmelCase						      =   tf.constant(
         [
             [
                 [8.921518, -10.589814, -6.4671307],
                 [-6.3967156, -13.911377, -1.1211915],
                 [-7.781247, -13.951557, -3.740592],
             ]
         ]		)
     self.assertTrue(numpy.allclose(output[:, :3, :3].numpy()      ,  expected_slice.numpy()      ,  atol=1E-2		)		)





 @slow
 def 				_snake_case (						self		)     ->				List[Any]:
     _lowerCAmelCase						      =   TFEsmModel.from_pretrained("facebook/esm2_t6_8M_UR50D"		)

     _lowerCAmelCase						      =   tf.constant([[0, 6, 4, 13, 5, 4, 16, 12, 11, 7, 2]]		)
     _lowerCAmelCase						      =   model(_lowerCAmelCase		)[0]
     # compare the actual values for a slice.
     _lowerCAmelCase						      =   tf.constant(
         [
             [
                 [0.14443092, 0.54125327, 0.3247739],
                 [0.30340484, 0.00526676, 0.31077722],
                 [0.32278043, -0.24987096, 0.3414628],
             ]
         ]		)
     self.assertTrue(numpy.allclose(output[:, :3, :3].numpy()      ,  expected_slice.numpy()      ,  atol=1E-4		)		)









import re
import time
from typing import Optional

import IPython.display as disp

from ..trainer_callback import TrainerCallback
from ..trainer_utils import IntervalStrategy, has_length






def 				_UpperCAmelCase			(    A     ):




   '''simple docstring'''

   UpperCAmelCase__						=int(A     )
   UpperCAmelCase__			,							UpperCAmelCase__			,							UpperCAmelCase__						=t // 3600, (t // 60) % 60, t % 60
   return F"""{h}:{m:02d}:{s:02d}""" if h != 0 else F"""{m:02d}:{s:02d}"""






def 				_UpperCAmelCase			(    A				,							A				,							A				,							A				,							A=300     ):




   '''simple docstring'''

   return F"""
    <div>
      {prefix}
      <progress value='{value}' max='{total}' style='width:{width}px; height:20px; vertical-align: middle;'></progress>
      {label}
    </div>
    """






def 				_UpperCAmelCase			(    A     ):




   '''simple docstring'''

   UpperCAmelCase__						="<table border=\"1\" class=\"dataframe\">\n"
   html_code += """  <thead>\n <tr style="text-align: left;">\n"""
   for i in items[0]:
      html_code += F"""      <th>{i}</th>\n"""
   html_code += "    </tr>\n  </thead>\n  <tbody>\n"
   for line in items[1:]:
      html_code += "    <tr>\n"
      for elt in line:
         UpperCAmelCase__						=F"""{elt:.6f}""" if isinstance(A				,							A     ) else str(A     )
         html_code += F"""      <td>{elt}</td>\n"""
      html_code += "    </tr>\n"
   html_code += "  </tbody>\n</table><p>"
   return html_code

class     snake_case_		:






 '''simple docstring'''





 __UpperCamelCase       =      5
 __UpperCamelCase       =      0.2

 def __init__(  self,		A_,		A_ = None,		A_ = True,		A_ = None,		A_ = 300,		)	->       Optional[Any]:
    UpperCAmelCase__						=total
    UpperCAmelCase__						="" if prefix is None else prefix
    UpperCAmelCase__						=leave
    UpperCAmelCase__						=parent
    UpperCAmelCase__						=width
    UpperCAmelCase__						=None
    UpperCAmelCase__						=None
    UpperCAmelCase__						=None

 def  __UpperCAmelCase						(  self,		A_,		A_ = False,		A_ = None		)	->       Any:
    UpperCAmelCase__						=value
    if comment is not None:
       UpperCAmelCase__						=comment
    if self.last_value is None:
       UpperCAmelCase__						=UpperCAmelCase__						=time.time()
       UpperCAmelCase__						=UpperCAmelCase__						=value
       UpperCAmelCase__						=UpperCAmelCase__						=None
       UpperCAmelCase__						=self.warmup
       UpperCAmelCase__						=1
       self.update_bar(A_		)
    elif value <= self.last_value and not force_update:
       return
    elif force_update or self.first_calls > 0 or value >= min(self.last_value + self.wait_for,		self.total		):
       if self.first_calls > 0:
          self.first_calls -= 1
       UpperCAmelCase__						=time.time()
       UpperCAmelCase__						=current_time - self.start_time
       # We could have value = self.start_value if the update is called twixe with the same start value.
       if value > self.start_value:
          UpperCAmelCase__						=self.elapsed_time / (value - self.start_value)
       else:
          UpperCAmelCase__						=None
       if value >= self.total:
          UpperCAmelCase__						=self.total
          UpperCAmelCase__						=None
          if not self.leave:
             self.close()
       elif self.average_time_per_item is not None:
          UpperCAmelCase__						=self.average_time_per_item * (self.total - value)
       self.update_bar(A_		)
       UpperCAmelCase__						=value
       UpperCAmelCase__						=current_time
       if self.average_time_per_item is None:
          UpperCAmelCase__						=1
       else:
          UpperCAmelCase__						=max(int(self.update_every / self.average_time_per_item		),		1		)

 def  __UpperCAmelCase						(  self,		A_,		A_=None		)	->       Dict:
    UpperCAmelCase__						=" " * (len(str(self.total		)		) - len(str(A_		)		)) + str(A_		)
    if self.elapsed_time is None:
       UpperCAmelCase__						=f"""[{spaced_value}/{self.total} : < :"""
    elif self.predicted_remaining is None:
       UpperCAmelCase__						=f"""[{spaced_value}/{self.total} {format_time(self.elapsed_time		)}"""
    else:
       UpperCAmelCase__						=(
           f"""[{spaced_value}/{self.total} {format_time(self.elapsed_time		)} <"""
           f""" {format_time(self.predicted_remaining		)}"""
       )
       self.label += f""", {1/self.average_time_per_item:.2f} it/s"""
    self.label += "]" if self.comment is None or len(self.comment		) == 0 else f""", {self.comment}]"""
    self.display()

 def  __UpperCAmelCase						(  self		)	->       Tuple:
    UpperCAmelCase__						=html_progress_bar(self.value,		self.total,		self.prefix,		self.label,		self.width		)
    if self.parent is not None:
       # If this is a child bar, the parent will take care of the display.
       self.parent.display()
       return
    if self.output is None:
       UpperCAmelCase__						=disp.display(disp.HTML(self.html_code		),		display_id=A_		)
    else:
       self.output.update(disp.HTML(self.html_code		)		)






 def  __UpperCAmelCase						(  self		)	->       str:
    if self.parent is None and self.output is not None:
       self.output.update(disp.HTML(""		)		)

class     snake_case_		(   a							):






 '''simple docstring'''





 def __init__(  self,		A_,		A_=None		)	->       Dict:
    super().__init__(A_		)
    UpperCAmelCase__						=None if column_names is None else [column_names]
    UpperCAmelCase__						=None

 def  __UpperCAmelCase						(  self		)	->       int:
    UpperCAmelCase__						=html_progress_bar(self.value,		self.total,		self.prefix,		self.label,		self.width		)
    if self.inner_table is not None:
       self.html_code += text_to_html_table(self.inner_table		)
    if self.child_bar is not None:
       self.html_code += self.child_bar.html_code
    if self.output is None:
       UpperCAmelCase__						=disp.display(disp.HTML(self.html_code		),		display_id=A_		)
    else:
       self.output.update(disp.HTML(self.html_code		)		)

 def  __UpperCAmelCase						(  self,		A_		)	->       Tuple:
    if self.inner_table is None:
       UpperCAmelCase__						=[list(values.keys()		), list(values.values()		)]
    else:
       UpperCAmelCase__						=self.inner_table[0]
       if len(self.inner_table		) == 1:
          # We give a chance to update the column names at the first iteration
          for key in values.keys():
             if key not in columns:
                columns.append(A_		)
          UpperCAmelCase__						=columns
       self.inner_table.append([values[c] for c in columns]		)

 def  __UpperCAmelCase						(  self,		A_,		A_=None,		A_=300		)	->       Union[str, Any]:
    UpperCAmelCase__						=NotebookProgressBar(A_,		prefix=A_,		parent=self,		width=A_		)
    return self.child_bar






 def  __UpperCAmelCase						(  self		)	->       Tuple:
    UpperCAmelCase__						=None
    self.display()

class     snake_case_		(   a							):






 '''simple docstring'''





 def __init__(  self		)	->       Optional[int]:
    UpperCAmelCase__						=None
    UpperCAmelCase__						=None
    UpperCAmelCase__						=False

 def  __UpperCAmelCase						(  self,		A_,		A_,		A_,		**A_		)	->       str:
    UpperCAmelCase__						="Epoch" if args.evaluation_strategy == IntervalStrategy.EPOCH else "Step"
    UpperCAmelCase__						=0
    UpperCAmelCase__						=0
    UpperCAmelCase__						=[self.first_column] + ["Training Loss"]
    if args.evaluation_strategy != IntervalStrategy.NO:
       column_names.append("Validation Loss"		)
    UpperCAmelCase__						=NotebookTrainingTracker(state.max_steps,		A_		)

 def  __UpperCAmelCase						(  self,		A_,		A_,		A_,		**A_		)	->       str:
    UpperCAmelCase__						=int(state.epoch		) if int(state.epoch		) == state.epoch else f"""{state.epoch:.2f}"""
    self.training_tracker.update(
        state.global_step + 1,		comment=f"""Epoch {epoch}/{state.num_train_epochs}""",		force_update=self._force_next_update,		)
    UpperCAmelCase__						=False

 def  __UpperCAmelCase						(  self,		A_,		A_,		A_,		A_=None,		**A_		)	->       int:
    if not has_length(A_		):
       return
    if self.prediction_bar is None:
       if self.training_tracker is not None:
          UpperCAmelCase__						=self.training_tracker.add_child(len(A_		)		)
       else:
          UpperCAmelCase__						=NotebookProgressBar(len(A_		)		)
       self.prediction_bar.update(1		)
    else:
       self.prediction_bar.update(self.prediction_bar.value + 1		)

 def  __UpperCAmelCase						(  self,		A_,		A_,		A_,		**A_		)	->       Optional[Any]:
    if self.prediction_bar is not None:
       self.prediction_bar.close()
    UpperCAmelCase__						=None

 def  __UpperCAmelCase						(  self,		A_,		A_,		A_,		A_=None,		**A_		)	->       str:
    # Only for when there is no evaluation
    if args.evaluation_strategy == IntervalStrategy.NO and "loss" in logs:
       UpperCAmelCase__						={"Training Loss": logs["loss"]}
       # First column is necessarily Step sine we're not in epoch eval strategy
       UpperCAmelCase__						=state.global_step
       self.training_tracker.write_line(A_		)

 def  __UpperCAmelCase						(  self,		A_,		A_,		A_,		A_=None,		**A_		)	->       str:
    if self.training_tracker is not None:
       UpperCAmelCase__						={"Training Loss": "No log", "Validation Loss": "No log"}
       for log in reversed(state.log_history		):
          if "loss" in log:
             UpperCAmelCase__						=log["loss"]
             break

       if self.first_column == "Epoch":
          UpperCAmelCase__						=int(state.epoch		)
       else:
          UpperCAmelCase__						=state.global_step
       UpperCAmelCase__						="eval"
       for k in metrics:
          if k.endswith("_loss"		):
             UpperCAmelCase__						=re.sub(R"\_loss$",		"",		A_		)
       UpperCAmelCase__						=metrics.pop("total_flos",		A_		)
       UpperCAmelCase__						=metrics.pop("epoch",		A_		)
       UpperCAmelCase__						=metrics.pop(f"""{metric_key_prefix}_runtime""",		A_		)
       UpperCAmelCase__						=metrics.pop(f"""{metric_key_prefix}_samples_per_second""",		A_		)
       UpperCAmelCase__						=metrics.pop(f"""{metric_key_prefix}_steps_per_second""",		A_		)
       UpperCAmelCase__						=metrics.pop(f"""{metric_key_prefix}_jit_compilation_time""",		A_		)
       for k, v in metrics.items():
          if k == f"""{metric_key_prefix}_loss""":
             UpperCAmelCase__						=v
          else:
             UpperCAmelCase__						=k.split("_"		)
             UpperCAmelCase__						=" ".join([part.capitalize() for part in splits[1:]]		)
             UpperCAmelCase__						=v
       self.training_tracker.write_line(A_		)
       self.training_tracker.remove_child()
       UpperCAmelCase__						=None
       # Evaluation takes a long time so we should force the next update.
       UpperCAmelCase__						=True






 def  __UpperCAmelCase						(  self,		A_,		A_,		A_,		**A_		)	->       List[str]:
    self.training_tracker.update(
        state.global_step,		comment=f"""Epoch {int(state.epoch		)}/{state.num_train_epochs}""",		force_update=A_		)
    UpperCAmelCase__						=None



