





from . import __version__

# Backward compatibility imports, to make sure all those objects can be found in file_utils
from .utils import (
    CLOUDFRONT_DISTRIB_PREFIX,
    CONFIG_NAME,
    DISABLE_TELEMETRY,
    DUMMY_INPUTS,
    DUMMY_MASK,
    ENV_VARS_TRUE_AND_AUTO_VALUES,
    ENV_VARS_TRUE_VALUES,
    FEATURE_EXTRACTOR_NAME,
    FLAX_WEIGHTS_NAME,
    HF_MODULES_CACHE,
    HUGGINGFACE_CO_PREFIX,
    HUGGINGFACE_CO_RESOLVE_ENDPOINT,
    MODEL_CARD_NAME,
    MULTIPLE_CHOICE_DUMMY_INPUTS,
    PYTORCH_PRETRAINED_BERT_CACHE,
    PYTORCH_TRANSFORMERS_CACHE,
    S3_BUCKET_PREFIX,
    SENTENCEPIECE_UNDERLINE,
    SPIECE_UNDERLINE,
    TF2_WEIGHTS_NAME,
    TF_WEIGHTS_NAME,
    TORCH_FX_REQUIRED_VERSION,
    TRANSFORMERS_CACHE,
    TRANSFORMERS_DYNAMIC_MODULE_NAME,
    USE_JAX,
    USE_TF,
    USE_TORCH,
    WEIGHTS_INDEX_NAME,
    WEIGHTS_NAME,
    ContextManagers,
    DummyObject,
    EntryNotFoundError,
    ExplicitEnum,
    ModelOutput,
    PaddingStrategy,
    PushToHubMixin,
    RepositoryNotFoundError,
    RevisionNotFoundError,
    TensorType,
    _LazyModule,
    add_code_sample_docstrings,
    add_end_docstrings,
    add_start_docstrings,
    add_start_docstrings_to_model_forward,
    cached_property,
    copy_func,
    default_cache_path,
    define_sagemaker_information,
    get_cached_models,
    get_file_from_repo,
    get_full_repo_name,
    get_torch_version,
    has_file,
    http_user_agent,
    is_apex_available,
    is_bsa_available,
    is_coloredlogs_available,
    is_datasets_available,
    is_detectrona_available,
    is_faiss_available,
    is_flax_available,
    is_ftfy_available,
    is_in_notebook,
    is_ipex_available,
    is_librosa_available,
    is_offline_mode,
    is_onnx_available,
    is_pandas_available,
    is_phonemizer_available,
    is_protobuf_available,
    is_psutil_available,
    is_pyanvml_available,
    is_pyctcdecode_available,
    is_pytesseract_available,
    is_pytorch_quantization_available,
    is_rjieba_available,
    is_sagemaker_dp_enabled,
    is_sagemaker_mp_enabled,
    is_scipy_available,
    is_sentencepiece_available,
    is_seqio_available,
    is_sklearn_available,
    is_soundfile_availble,
    is_spacy_available,
    is_speech_available,
    is_tensor,
    is_tensorflow_probability_available,
    is_tfaonnx_available,
    is_tf_available,
    is_timm_available,
    is_tokenizers_available,
    is_torch_available,
    is_torch_bfaa_available,
    is_torch_cuda_available,
    is_torch_fx_available,
    is_torch_fx_proxy,
    is_torch_mps_available,
    is_torch_tfaa_available,
    is_torch_tpu_available,
    is_torchaudio_available,
    is_training_run_on_sagemaker,
    is_vision_available,
    replace_return_docstrings,
    requires_backends,
    to_numpy,
    to_py_obj,
    torch_only_method,
)








import gc
import unittest

from transformers import MODEL_FOR_MASKED_LM_MAPPING, TF_MODEL_FOR_MASKED_LM_MAPPING, FillMaskPipeline, pipeline
from transformers.pipelines import PipelineException
from transformers.testing_utils import (
    is_pipeline_test,
    is_torch_available,
    nested_simplify,
    require_tf,
    require_torch,
    require_torch_gpu,
    slow,
)

from .test_pipelines_common import ANY
@is_pipeline_test
class SCREAMING_SNAKE_CASE_						(					unittest.TestCase					):
						__magic_name__:			Union[str, Any]       =       MODEL_FOR_MASKED_LM_MAPPING
						__magic_name__:			Optional[int]       =       TF_MODEL_FOR_MASKED_LM_MAPPING






						def UpperCAmelCase_				(      self      :      str	)							->    str:







							"""simple docstring"""


							super().tearDown()
							# clean-up as much as possible GPU memory occupied by PyTorch
							gc.collect()
							if is_torch_available():
								import torch

								torch.cuda.empty_cache()






						@require_tf
						def UpperCAmelCase_				(      self      :      Optional[int]	)							->    Union[str, Any]:







							"""simple docstring"""


							snake_case_		:			int											=	pipeline(task='fill-mask'		,   model='sshleifer/tiny-distilroberta-base'		,   top_k=2		,   framework='tf'	)
							snake_case_		:			Optional[Any]											=	unmasker('My name is <mask>'	)
							self.assertEqual(
							    nested_simplify(_A		,   decimals=6	)		,   [
							        {'sequence': 'My name is grouped', 'score': 2.1E-05, 'token': 38015, 'token_str': ' grouped'},
							        {'sequence': 'My name is accuser', 'score': 2.1E-05, 'token': 25506, 'token_str': ' accuser'},
							    ]		,   )

							snake_case_		:			int											=	unmasker('The largest city in France is <mask>'	)
							self.assertEqual(
							    nested_simplify(_A		,   decimals=6	)		,   [
							        {
							            'sequence': 'The largest city in France is grouped',
							            'score': 2.1E-05,
							            'token': 38015,
							            'token_str': ' grouped',
							        },
							        {
							            'sequence': 'The largest city in France is accuser',
							            'score': 2.1E-05,
							            'token': 25506,
							            'token_str': ' accuser',
							        },
							    ]		,   )

							snake_case_		:			Any											=	unmasker('My name is <mask>'		,   targets=[' Patrick', ' Clara', ' Teven']		,   top_k=3	)
							self.assertEqual(
							    nested_simplify(_A		,   decimals=6	)		,   [
							        {'sequence': 'My name is Clara', 'score': 2E-05, 'token': 13606, 'token_str': ' Clara'},
							        {'sequence': 'My name is Patrick', 'score': 2E-05, 'token': 3499, 'token_str': ' Patrick'},
							        {'sequence': 'My name is Te', 'score': 1.9E-05, 'token': 2941, 'token_str': ' Te'},
							    ]		,   )






						@require_torch
						def UpperCAmelCase_				(      self      :      Union[str, Any]	)							->    Optional[Any]:







							"""simple docstring"""


							snake_case_		:			Tuple											=	pipeline(task='fill-mask'		,   model='sshleifer/tiny-distilroberta-base'		,   top_k=2		,   framework='pt'	)

							snake_case_		:			Tuple											=	unmasker('My name is <mask>'	)
							self.assertEqual(
							    nested_simplify(_A		,   decimals=6	)		,   [
							        {'sequence': 'My name is Maul', 'score': 2.2E-05, 'token': 35676, 'token_str': ' Maul'},
							        {'sequence': 'My name isELS', 'score': 2.2E-05, 'token': 16416, 'token_str': 'ELS'},
							    ]		,   )

							snake_case_		:			int											=	unmasker('The largest city in France is <mask>'	)
							self.assertEqual(
							    nested_simplify(_A		,   decimals=6	)		,   [
							        {
							            'sequence': 'The largest city in France is Maul',
							            'score': 2.2E-05,
							            'token': 35676,
							            'token_str': ' Maul',
							        },
							        {'sequence': 'The largest city in France isELS', 'score': 2.2E-05, 'token': 16416, 'token_str': 'ELS'},
							    ]		,   )

							snake_case_		:			Any											=	unmasker('My name is <mask>'		,   targets=[' Patrick', ' Clara', ' Teven']		,   top_k=3	)
							self.assertEqual(
							    nested_simplify(_A		,   decimals=6	)		,   [
							        {'sequence': 'My name is Patrick', 'score': 2.1E-05, 'token': 3499, 'token_str': ' Patrick'},
							        {'sequence': 'My name is Te', 'score': 2E-05, 'token': 2941, 'token_str': ' Te'},
							        {'sequence': 'My name is Clara', 'score': 2E-05, 'token': 13606, 'token_str': ' Clara'},
							    ]		,   )

							snake_case_		:			List[Any]											=	unmasker('My name is <mask> <mask>'		,   top_k=2	)

							self.assertEqual(
							    nested_simplify(_A		,   decimals=6	)		,   [
							        [
							            {
							                'score': 2.2E-05,
							                'token': 35676,
							                'token_str': ' Maul',
							                'sequence': '<s>My name is Maul<mask></s>',
							            },
							            {'score': 2.2E-05, 'token': 16416, 'token_str': 'ELS', 'sequence': '<s>My name isELS<mask></s>'},
							        ],
							        [
							            {
							                'score': 2.2E-05,
							                'token': 35676,
							                'token_str': ' Maul',
							                'sequence': '<s>My name is<mask> Maul</s>',
							            },
							            {'score': 2.2E-05, 'token': 16416, 'token_str': 'ELS', 'sequence': '<s>My name is<mask>ELS</s>'},
							        ],
							    ]		,   )






						@require_torch_gpu
						def UpperCAmelCase_				(      self      :      str	)							->    Any:







							"""simple docstring"""


							snake_case_		:			Union[str, Any]											=	pipeline('fill-mask'		,   model='hf-internal-testing/tiny-random-distilbert'		,   device=0		,   framework='pt'	)

							# convert model to fp16
							pipe.model.half()

							snake_case_		:			Tuple											=	pipe('Paris is the [MASK] of France.'	)
							# We actually don't care about the result, we just want to make sure
							# it works, meaning the float16 tensor got casted back to float32
							# for postprocessing.
							self.assertIsInstance(_A		,   _A	)






						@slow
						@require_torch
						def UpperCAmelCase_				(      self      :      str	)							->    List[Any]:







							"""simple docstring"""


							snake_case_		:			Optional[Any]											=	pipeline(task='fill-mask'		,   model='distilroberta-base'		,   top_k=2		,   framework='pt'	)
							self.run_large_test(_A	)






						@slow
						@require_tf
						def UpperCAmelCase_				(      self      :      Optional[int]	)							->    int:







							"""simple docstring"""


							snake_case_		:			Dict											=	pipeline(task='fill-mask'		,   model='distilroberta-base'		,   top_k=2		,   framework='tf'	)
							self.run_large_test(_A	)






						def UpperCAmelCase_				(      self      :      Dict		,   _A      :      List[Any]	)							->    Union[str, Any]:







							"""simple docstring"""


							snake_case_		:			List[Any]											=	unmasker('My name is <mask>'	)
							self.assertEqual(
							    nested_simplify(_A	)		,   [
							        {'sequence': 'My name is John', 'score': 0.0_0_8, 'token': 610, 'token_str': ' John'},
							        {'sequence': 'My name is Chris', 'score': 0.0_0_7, 'token': 1573, 'token_str': ' Chris'},
							    ]		,   )
							snake_case_		:			List[Any]											=	unmasker('The largest city in France is <mask>'	)
							self.assertEqual(
							    nested_simplify(_A	)		,   [
							        {
							            'sequence': 'The largest city in France is Paris',
							            'score': 0.2_5_1,
							            'token': 2201,
							            'token_str': ' Paris',
							        },
							        {
							            'sequence': 'The largest city in France is Lyon',
							            'score': 0.2_1_4,
							            'token': 12790,
							            'token_str': ' Lyon',
							        },
							    ]		,   )

							snake_case_		:			Tuple											=	unmasker('My name is <mask>'		,   targets=[' Patrick', ' Clara', ' Teven']		,   top_k=3	)
							self.assertEqual(
							    nested_simplify(_A	)		,   [
							        {'sequence': 'My name is Patrick', 'score': 0.0_0_5, 'token': 3499, 'token_str': ' Patrick'},
							        {'sequence': 'My name is Clara', 'score': 0.0_0_0, 'token': 13606, 'token_str': ' Clara'},
							        {'sequence': 'My name is Te', 'score': 0.0_0_0, 'token': 2941, 'token_str': ' Te'},
							    ]		,   )






						@require_torch
						def UpperCAmelCase_				(      self      :      Optional[int]	)							->    Any:







							"""simple docstring"""


							snake_case_		:			Optional[Any]											=	pipeline(task='fill-mask'		,   model='sshleifer/tiny-distilroberta-base'		,   framework='pt'	)
							snake_case_		:			Tuple											=	None
							snake_case_		:			str											=	None
							self.run_pipeline_test(_A		,   []	)






						@require_tf
						def UpperCAmelCase_				(      self      :      Tuple	)							->    Dict:







							"""simple docstring"""


							snake_case_		:			List[Any]											=	pipeline(task='fill-mask'		,   model='sshleifer/tiny-distilroberta-base'		,   framework='tf'	)
							snake_case_		:			List[str]											=	None
							snake_case_		:			List[str]											=	None
							self.run_pipeline_test(_A		,   []	)






						def UpperCAmelCase_				(      self      :      List[str]		,   _A      :      List[Any]		,   _A      :      Tuple		,   _A      :      Optional[int]	)							->    Optional[Any]:







							"""simple docstring"""


							if tokenizer is None or tokenizer.mask_token_id is None:
								self.skipTest('The provided tokenizer has no mask token, (probably reformer or wav2vec2)'	)

							snake_case_		:			Dict											=	FillMaskPipeline(model=_A		,   tokenizer=_A	)
							snake_case_		:			Optional[Any]											=	[
							    F"""This is another {tokenizer.mask_token} test""",
							]
							return fill_masker, examples






						def UpperCAmelCase_				(      self      :      Optional[Any]		,   _A      :      str		,   _A      :      List[Any]	)							->    int:







							"""simple docstring"""


							snake_case_		:			Optional[int]											=	fill_masker.tokenizer
							snake_case_		:			List[Any]											=	fill_masker.model

							snake_case_		:			int											=	fill_masker(
							    F"""This is a {tokenizer.mask_token}"""		,   )
							self.assertEqual(
							    _A		,   [
							        {'sequence': ANY(_A	), 'score': ANY(_A	), 'token': ANY(_A	), 'token_str': ANY(_A	)},
							        {'sequence': ANY(_A	), 'score': ANY(_A	), 'token': ANY(_A	), 'token_str': ANY(_A	)},
							        {'sequence': ANY(_A	), 'score': ANY(_A	), 'token': ANY(_A	), 'token_str': ANY(_A	)},
							        {'sequence': ANY(_A	), 'score': ANY(_A	), 'token': ANY(_A	), 'token_str': ANY(_A	)},
							        {'sequence': ANY(_A	), 'score': ANY(_A	), 'token': ANY(_A	), 'token_str': ANY(_A	)},
							    ]		,   )

							snake_case_		:			Dict											=	fill_masker([F"""This is a {tokenizer.mask_token}"""]	)
							self.assertEqual(
							    _A		,   [
							        {'sequence': ANY(_A	), 'score': ANY(_A	), 'token': ANY(_A	), 'token_str': ANY(_A	)},
							        {'sequence': ANY(_A	), 'score': ANY(_A	), 'token': ANY(_A	), 'token_str': ANY(_A	)},
							        {'sequence': ANY(_A	), 'score': ANY(_A	), 'token': ANY(_A	), 'token_str': ANY(_A	)},
							        {'sequence': ANY(_A	), 'score': ANY(_A	), 'token': ANY(_A	), 'token_str': ANY(_A	)},
							        {'sequence': ANY(_A	), 'score': ANY(_A	), 'token': ANY(_A	), 'token_str': ANY(_A	)},
							    ]		,   )

							snake_case_		:			Optional[int]											=	fill_masker([F"""This is a {tokenizer.mask_token}""", F"""Another {tokenizer.mask_token} great test."""]	)
							self.assertEqual(
							    _A		,   [
							        [
							            {'sequence': ANY(_A	), 'score': ANY(_A	), 'token': ANY(_A	), 'token_str': ANY(_A	)},
							            {'sequence': ANY(_A	), 'score': ANY(_A	), 'token': ANY(_A	), 'token_str': ANY(_A	)},
							            {'sequence': ANY(_A	), 'score': ANY(_A	), 'token': ANY(_A	), 'token_str': ANY(_A	)},
							            {'sequence': ANY(_A	), 'score': ANY(_A	), 'token': ANY(_A	), 'token_str': ANY(_A	)},
							            {'sequence': ANY(_A	), 'score': ANY(_A	), 'token': ANY(_A	), 'token_str': ANY(_A	)},
							        ],
							        [
							            {'sequence': ANY(_A	), 'score': ANY(_A	), 'token': ANY(_A	), 'token_str': ANY(_A	)},
							            {'sequence': ANY(_A	), 'score': ANY(_A	), 'token': ANY(_A	), 'token_str': ANY(_A	)},
							            {'sequence': ANY(_A	), 'score': ANY(_A	), 'token': ANY(_A	), 'token_str': ANY(_A	)},
							            {'sequence': ANY(_A	), 'score': ANY(_A	), 'token': ANY(_A	), 'token_str': ANY(_A	)},
							            {'sequence': ANY(_A	), 'score': ANY(_A	), 'token': ANY(_A	), 'token_str': ANY(_A	)},
							        ],
							    ]		,   )

							with self.assertRaises(_A	):
								fill_masker([None]	)
							# No mask_token is not supported
							with self.assertRaises(_A	):
								fill_masker('This is'	)

							self.run_test_top_k(_A		,   _A	)
							self.run_test_targets(_A		,   _A	)
							self.run_test_top_k_targets(_A		,   _A	)
							self.fill_mask_with_duplicate_targets_and_top_k(_A		,   _A	)
							self.fill_mask_with_multiple_masks(_A		,   _A	)






						def UpperCAmelCase_				(      self      :      Optional[Any]		,   _A      :      Any		,   _A      :      Optional[int]	)							->    Any:







							"""simple docstring"""


							snake_case_		:			Dict											=	tokenizer.get_vocab()
							snake_case_		:			List[Any]											=	sorted(vocab.keys()	)[:2]
							# Pipeline argument
							snake_case_		:			Dict											=	FillMaskPipeline(model=_A		,   tokenizer=_A		,   targets=_A	)
							snake_case_		:			Optional[int]											=	fill_masker(F"""This is a {tokenizer.mask_token}"""	)
							self.assertEqual(
							    _A		,   [
							        {'sequence': ANY(_A	), 'score': ANY(_A	), 'token': ANY(_A	), 'token_str': ANY(_A	)},
							        {'sequence': ANY(_A	), 'score': ANY(_A	), 'token': ANY(_A	), 'token_str': ANY(_A	)},
							    ]		,   )
							snake_case_		:			List[str]											=	{vocab[el] for el in targets}
							self.assertEqual({el['token'] for el in outputs}		,   _A	)
							snake_case_		:			int											=	[tokenizer.decode([x]	) for x in target_ids]
							self.assertEqual({el['token_str'] for el in outputs}		,   set(_A	)	)

							# Call argument
							snake_case_		:			Dict											=	FillMaskPipeline(model=_A		,   tokenizer=_A	)
							snake_case_		:			Optional[int]											=	fill_masker(F"""This is a {tokenizer.mask_token}"""		,   targets=_A	)
							self.assertEqual(
							    _A		,   [
							        {'sequence': ANY(_A	), 'score': ANY(_A	), 'token': ANY(_A	), 'token_str': ANY(_A	)},
							        {'sequence': ANY(_A	), 'score': ANY(_A	), 'token': ANY(_A	), 'token_str': ANY(_A	)},
							    ]		,   )
							snake_case_		:			Any											=	{vocab[el] for el in targets}
							self.assertEqual({el['token'] for el in outputs}		,   _A	)
							snake_case_		:			Tuple											=	[tokenizer.decode([x]	) for x in target_ids]
							self.assertEqual({el['token_str'] for el in outputs}		,   set(_A	)	)

							# Score equivalence
							snake_case_		:			Union[str, Any]											=	fill_masker(F"""This is a {tokenizer.mask_token}"""		,   targets=_A	)
							snake_case_		:			Any											=	[top_mask['token_str'] for top_mask in outputs]
							snake_case_		:			Optional[Any]											=	[top_mask['score'] for top_mask in outputs]

							# For some BPE tokenizers, `</w>` is removed during decoding, so `token_str` won't be the same as in `targets`.
							if set(_A	) == set(_A	):
								snake_case_		:			int											=	fill_masker(F"""This is a {tokenizer.mask_token}"""		,   targets=_A	)
								snake_case_		:			Union[str, Any]											=	[top_mask['score'] for top_mask in unmasked_targets]
								self.assertEqual(nested_simplify(_A	)		,   nested_simplify(_A	)	)

							# Raises with invalid
							with self.assertRaises(_A	):
								snake_case_		:			Dict											=	fill_masker(F"""This is a {tokenizer.mask_token}"""		,   targets=[]	)
							# For some tokenizers, `""` is actually in the vocabulary and the expected error won't raised
							if "" not in tokenizer.get_vocab():
								with self.assertRaises(_A	):
									snake_case_		:			Tuple											=	fill_masker(F"""This is a {tokenizer.mask_token}"""		,   targets=['']	)
								with self.assertRaises(_A	):
									snake_case_		:			Union[str, Any]											=	fill_masker(F"""This is a {tokenizer.mask_token}"""		,   targets=''	)






						def UpperCAmelCase_				(      self      :      Tuple		,   _A      :      Any		,   _A      :      Optional[Any]	)							->    Any:







							"""simple docstring"""


							snake_case_		:			str											=	FillMaskPipeline(model=_A		,   tokenizer=_A		,   top_k=2	)
							snake_case_		:			List[str]											=	fill_masker(F"""This is a {tokenizer.mask_token}"""	)
							self.assertEqual(
							    _A		,   [
							        {'sequence': ANY(_A	), 'score': ANY(_A	), 'token': ANY(_A	), 'token_str': ANY(_A	)},
							        {'sequence': ANY(_A	), 'score': ANY(_A	), 'token': ANY(_A	), 'token_str': ANY(_A	)},
							    ]		,   )

							snake_case_		:			Any											=	FillMaskPipeline(model=_A		,   tokenizer=_A	)
							snake_case_		:			int											=	fill_masker(F"""This is a {tokenizer.mask_token}"""		,   top_k=2	)
							self.assertEqual(
							    _A		,   [
							        {'sequence': ANY(_A	), 'score': ANY(_A	), 'token': ANY(_A	), 'token_str': ANY(_A	)},
							        {'sequence': ANY(_A	), 'score': ANY(_A	), 'token': ANY(_A	), 'token_str': ANY(_A	)},
							    ]		,   )
							self.assertEqual(nested_simplify(_A	)		,   nested_simplify(_A	)	)






						def UpperCAmelCase_				(      self      :      Tuple		,   _A      :      Any		,   _A      :      Dict	)							->    str:







							"""simple docstring"""


							snake_case_		:			str											=	tokenizer.get_vocab()
							snake_case_		:			Tuple											=	FillMaskPipeline(model=_A		,   tokenizer=_A	)

							# top_k=2, ntargets=3
							snake_case_		:			str											=	sorted(vocab.keys()	)[:3]
							snake_case_		:			Union[str, Any]											=	fill_masker(F"""This is a {tokenizer.mask_token}"""		,   top_k=2		,   targets=_A	)

							# If we use the most probably targets, and filter differently, we should still
							# have the same results
							snake_case_		:			Any											=	[el['token_str'] for el in sorted(_A		,   key=lambda _A	: x["score"]		,   reverse=_A	)]
							# For some BPE tokenizers, `</w>` is removed during decoding, so `token_str` won't be the same as in `targets`.
							if set(_A	).issubset(_A	):
								snake_case_		:			str											=	fill_masker(F"""This is a {tokenizer.mask_token}"""		,   top_k=3		,   targets=_A	)
								# They should yield exactly the same result
								self.assertEqual(nested_simplify(_A	)		,   nested_simplify(_A	)	)






						def UpperCAmelCase_				(      self      :      str		,   _A      :      Dict		,   _A      :      Tuple	)							->    Dict:







							"""simple docstring"""


							snake_case_		:			Tuple											=	FillMaskPipeline(model=_A		,   tokenizer=_A	)
							snake_case_		:			List[Any]											=	tokenizer.get_vocab()
							# String duplicates + id duplicates
							snake_case_		:			str											=	sorted(vocab.keys()	)[:3]
							snake_case_		:			Tuple											=	[targets[0], targets[1], targets[0], targets[2], targets[1]]
							snake_case_		:			str											=	fill_masker(F"""My name is {tokenizer.mask_token}"""		,   targets=_A		,   top_k=10	)

							# The target list contains duplicates, so we can't output more
							# than them
							self.assertEqual(len(_A	)		,   3	)






						def UpperCAmelCase_				(      self      :      List[str]		,   _A      :      str		,   _A      :      Union[str, Any]	)							->    Optional[Any]:







							"""simple docstring"""


							snake_case_		:			Union[str, Any]											=	FillMaskPipeline(model=_A		,   tokenizer=_A	)

							snake_case_		:			List[str]											=	fill_masker(
							    F"""This is a {tokenizer.mask_token} {tokenizer.mask_token} {tokenizer.mask_token}"""		,   top_k=2	)
							self.assertEqual(
							    _A		,   [
							        [
							            {'sequence': ANY(_A	), 'score': ANY(_A	), 'token': ANY(_A	), 'token_str': ANY(_A	)},
							            {'sequence': ANY(_A	), 'score': ANY(_A	), 'token': ANY(_A	), 'token_str': ANY(_A	)},
							        ],
							        [
							            {'sequence': ANY(_A	), 'score': ANY(_A	), 'token': ANY(_A	), 'token_str': ANY(_A	)},
							            {'sequence': ANY(_A	), 'score': ANY(_A	), 'token': ANY(_A	), 'token_str': ANY(_A	)},
							        ],
							        [
							            {'sequence': ANY(_A	), 'score': ANY(_A	), 'token': ANY(_A	), 'token_str': ANY(_A	)},
							            {'sequence': ANY(_A	), 'score': ANY(_A	), 'token': ANY(_A	), 'token_str': ANY(_A	)},
							        ],
							    ]		,   )

