





'''simple docstring'''
from __future__ import annotations

import unittest

from transformers import is_tf_available
from transformers.testing_utils import require_sentencepiece, require_tf, require_tokenizers, slow


if is_tf_available():
    import tensorflow as tf

    from transformers import AutoTokenizer, TFAutoModelForSeqaSeqLM

@require_tf
@require_sentencepiece
@require_tokenizers
class      snake_case     (    unittest.TestCase       ):




 """simple docstring"""



 @slow
 def        _lowerCamelCase					(       self       :							Optional[Any]	):
        __UpperCamelCase       =  TFAutoModelForSeqaSeqLM.from_pretrained('google/mt5-small'	)
        __UpperCamelCase       =  AutoTokenizer.from_pretrained('google/mt5-small'	)

        __UpperCamelCase       =  tokenizer('Hello there'							,	return_tensors='tf'	).input_ids
        __UpperCamelCase       =  tokenizer('Hi I am'							,	return_tensors='tf'	).input_ids

        __UpperCamelCase       =  model(__A							,	labels=__A	).loss
        __UpperCamelCase       =  -tf.math.reduce_mean(__A	).numpy()

        __UpperCamelCase       =  -21.22_8168
        self.assertTrue(abs(mtf_score - EXPECTED_SCORE	) < 2e-4	)







from diffusers.utils.testing_utils import require_onnxruntime







@require_onnxruntime
class 				__lowerCAmelCase       :
      pass






