


'''simple docstring'''



def       _UpperCamelCase (						UpperCamelCase__ = 3	, UpperCamelCase__ = 7	, UpperCamelCase__ = 1_0_0_0_0_0_0   ):
			UpperCAmelCase__					:   List[str]       				=       0
			UpperCAmelCase__					:   int       				=       1

			for current_denominator in range(1	, limit + 1   ):
						UpperCAmelCase__					:   Tuple       				=       current_denominator * numerator // denominator
						if current_denominator % denominator == 0:
									current_numerator -= 1
						if current_numerator * max_denominator > current_denominator * max_numerator:
									UpperCAmelCase__					:   Optional[int]       				=       current_numerator
									UpperCAmelCase__					:   Tuple       				=       current_denominator
			return max_numerator


if __name__ == "__main__":
		print(solution(numerator=3, denominator=7, limit=1_00_00_00))



'''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		):




					@slow
					def 			snake_case__  ( self):
								UpperCAmelCase__					:   Optional[int]       				=       TFAutoModelForSeqaSeqLM.from_pretrained("""google/mt5-small""")
								UpperCAmelCase__					:   str       				=       AutoTokenizer.from_pretrained("""google/mt5-small""")

								UpperCAmelCase__					:   Optional[Any]       				=       tokenizer("""Hello there"""							,							return_tensors="""tf""").input_ids
								UpperCAmelCase__					:   Tuple       				=       tokenizer("""Hi I am"""							,							return_tensors="""tf""").input_ids

								UpperCAmelCase__					:   List[Any]       				=       model(_lowerCamelCase							,							labels=_lowerCamelCase).loss
								UpperCAmelCase__					:   Tuple       				=       -tf.math.reduce_mean(_lowerCamelCase).numpy()

								UpperCAmelCase__					:   Optional[int]       				=       -21.228168
								self.assertTrue(abs(mtf_score - EXPECTED_SCORE) < 2e-4)