


from __future__ import annotations

import unittest

from transformers import AutoTokenizer, GPTJConfig, is_tf_available
from transformers.testing_utils import require_tf, slow, tooslow

from ...test_configuration_common import ConfigTester
from ...test_modeling_tf_common import TFModelTesterMixin, ids_tensor, random_attention_mask
from ...test_pipeline_mixin import PipelineTesterMixin
from ...utils.test_modeling_tf_core import TFCoreModelTesterMixin


if is_tf_available():
							import tensorflow as tf

							from transformers.models.gptj.modeling_tf_gptj import (
							    TFGPTJForCausalLM,
							    TFGPTJForQuestionAnswering,
							    TFGPTJForSequenceClassification,
							    TFGPTJModel,
							    shape_list,
							)







class     __lowerCamelCase     :


							"""simple docstring"""

							def __init__(  self						,       UpperCAmelCase  )     ->       Any:






								'''simple docstring'''






								lowercase_			 = parent
								lowercase_			 = 13
								lowercase_			 = 7
								lowercase_			 = True
								lowercase_			 = True
								lowercase_			 = True
								lowercase_			 = True
								lowercase_			 = True
								lowercase_			 = 99
								lowercase_			 = 32
								lowercase_			 = 4
								lowercase_			 = 2
								lowercase_			 = 4
								lowercase_			 = 37
								lowercase_			 = "gelu"
								lowercase_			 = 0.1
								lowercase_			 = 0.1
								lowercase_			 = 512
								lowercase_			 = 16
								lowercase_			 = 2
								lowercase_			 = 0.02
								lowercase_			 = 3
								lowercase_			 = 4
								lowercase_			 = None
								lowercase_			 = self.vocab_size - 1
								lowercase_			 = self.vocab_size - 1
								lowercase_			 = self.vocab_size - 1




							def 				A__      (  self  )     ->       int:






								'''simple docstring'''






								lowercase_			 = ids_tensor([self.batch_size, self.seq_length]						,       self.vocab_size  )

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

								lowercase_			 = None
								if self.use_token_type_ids:
									lowercase_			 = ids_tensor([self.batch_size, self.seq_length]						,       self.type_vocab_size  )

								lowercase_			 = None
								if self.use_mc_token_ids:
									lowercase_			 = ids_tensor([self.batch_size, self.num_choices]						,       self.seq_length  )

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

								lowercase_			 = GPTJConfig(
								    vocab_size=self.vocab_size						,       n_embd=self.hidden_size						,       n_layer=self.num_hidden_layers						,       n_head=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						,       n_positions=self.max_position_embeddings						,       type_vocab_size=self.type_vocab_size						,       initializer_range=self.initializer_range						,       bos_token_id=self.bos_token_id						,       eos_token_id=self.eos_token_id						,       pad_token_id=self.pad_token_id						,       rotary_dim=self.rotary_dim						,       return_dict=UpperCAmelCase						,       )

								lowercase_			 = ids_tensor([self.num_hidden_layers, self.num_attention_heads]						,       2  )

								return (
								    config,
								    input_ids,
								    input_mask,
								    head_mask,
								    token_type_ids,
								    mc_token_ids,
								    sequence_labels,
								    token_labels,
								    choice_labels,
								)




							def 				A__      (  self						,       UpperCAmelCase						,       UpperCAmelCase						,       UpperCAmelCase						,       UpperCAmelCase						,       UpperCAmelCase						,       *UpperCAmelCase  )     ->       Union[str, Any]:






								'''simple docstring'''






								lowercase_			 = TFGPTJModel(config=UpperCAmelCase  )
								lowercase_			 = {
								    "input_ids": input_ids,
								    "attention_mask": input_mask,
								    "token_type_ids": token_type_ids,
								}
								lowercase_			 = model(UpperCAmelCase  )

								lowercase_			 = [input_ids, None, input_mask]  # None is the input for 'past'
								lowercase_			 = model(UpperCAmelCase  )

								lowercase_			 = model(UpperCAmelCase  )

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




							def 				A__      (  self						,       UpperCAmelCase						,       UpperCAmelCase						,       UpperCAmelCase						,       UpperCAmelCase						,       UpperCAmelCase						,       *UpperCAmelCase  )     ->       Optional[Any]:






								'''simple docstring'''






								lowercase_			 = TFGPTJModel(config=UpperCAmelCase  )

								# first forward pass
								lowercase_			 = model(UpperCAmelCase						,       token_type_ids=UpperCAmelCase						,       use_cache=UpperCAmelCase  )
								lowercase_			 = model(UpperCAmelCase						,       token_type_ids=UpperCAmelCase  )
								lowercase_			 = model(UpperCAmelCase						,       token_type_ids=UpperCAmelCase						,       use_cache=UpperCAmelCase  )

								self.parent.assertTrue(len(UpperCAmelCase  ) == len(UpperCAmelCase  )  )
								self.parent.assertTrue(len(UpperCAmelCase  ) == len(UpperCAmelCase  ) + 1  )

								lowercase_ ,	lowercase_			 = outputs.to_tuple()

								# create hypothetical next token and extent to next_input_ids
								lowercase_			 = ids_tensor((self.batch_size, 1)						,       config.vocab_size  )
								lowercase_			 = ids_tensor([self.batch_size, 1]						,       self.type_vocab_size  )

								# append to next input_ids and token_type_ids
								lowercase_			 = tf.concat([input_ids, next_tokens]						,       axis=-1  )
								lowercase_			 = tf.concat([token_type_ids, next_token_types]						,       axis=-1  )

								lowercase_			 = model(UpperCAmelCase						,       token_type_ids=UpperCAmelCase  )["last_hidden_state"]
								lowercase_			 = model(UpperCAmelCase						,       token_type_ids=UpperCAmelCase						,       past_key_values=UpperCAmelCase  )[
								    "last_hidden_state"
								]

								# select random slice
								lowercase_			 = int(ids_tensor((1,)						,       shape_list(UpperCAmelCase  )[-1]  )  )
								lowercase_			 = output_from_no_past[:, -1, random_slice_idx]
								lowercase_			 = output_from_past[:, 0, random_slice_idx]

								# test that outputs are equal for slice
								tf.debugging.assert_near(UpperCAmelCase						,       UpperCAmelCase						,       rtol=1e-6  )




							def 				A__      (  self						,       UpperCAmelCase						,       UpperCAmelCase						,       UpperCAmelCase						,       UpperCAmelCase						,       UpperCAmelCase						,       *UpperCAmelCase  )     ->       Dict:






								'''simple docstring'''






								lowercase_			 = TFGPTJModel(config=UpperCAmelCase  )

								# create attention mask
								lowercase_			 = self.seq_length // 2
								lowercase_			 = tf.ones((self.batch_size, half_seq_length)						,       dtype=tf.intaa  )
								lowercase_			 = tf.zeros((self.batch_size, self.seq_length - half_seq_length)						,       dtype=tf.intaa  )
								lowercase_			 = tf.concat([attn_mask_begin, attn_mask_end]						,       axis=1  )

								# first forward pass
								lowercase_ ,	lowercase_			 = model(UpperCAmelCase						,       attention_mask=UpperCAmelCase  ).to_tuple()

								# create hypothetical next token and extent to next_input_ids
								lowercase_			 = ids_tensor((self.batch_size, 1)						,       config.vocab_size  )

								# change a random masked slice from input_ids
								lowercase_			 = ids_tensor((1,)						,       UpperCAmelCase  ).numpy() + 1
								lowercase_			 = ids_tensor((self.batch_size, self.seq_length)						,       config.vocab_size  )
								lowercase_			 = tf.range(self.seq_length  ) == (self.seq_length - random_seq_idx_to_change)
								lowercase_			 = tf.transpose(
								    tf.broadcast_to(tf.expand_dims(UpperCAmelCase						,       -1  )						,       (self.seq_length, self.batch_size)  )  )
								lowercase_			 = tf.where(UpperCAmelCase						,       UpperCAmelCase						,       UpperCAmelCase  )

								# append to next input_ids and attn_mask
								lowercase_			 = tf.concat([input_ids, next_tokens]						,       axis=-1  )
								lowercase_			 = tf.concat([attn_mask, tf.ones((shape_list(UpperCAmelCase  )[0], 1)						,       dtype=tf.intaa  )]						,       axis=1  )

								# get two different outputs
								lowercase_			 = model(UpperCAmelCase						,       attention_mask=UpperCAmelCase  )["last_hidden_state"]
								lowercase_			 = model(UpperCAmelCase						,       past_key_values=UpperCAmelCase						,       attention_mask=UpperCAmelCase  )[
								    "last_hidden_state"
								]

								# select random slice
								lowercase_			 = int(ids_tensor((1,)						,       shape_list(UpperCAmelCase  )[-1]  )  )
								lowercase_			 = output_from_no_past[:, -1, random_slice_idx]
								lowercase_			 = output_from_past[:, 0, random_slice_idx]

								# test that outputs are equal for slice
								tf.debugging.assert_near(UpperCAmelCase						,       UpperCAmelCase						,       rtol=1e-12  )




							def 				A__      (  self						,       UpperCAmelCase						,       UpperCAmelCase						,       UpperCAmelCase						,       UpperCAmelCase						,       UpperCAmelCase						,       *UpperCAmelCase  )     ->       int:






								'''simple docstring'''






								lowercase_			 = TFGPTJModel(config=UpperCAmelCase  )

								lowercase_			 = input_ids[:1, :]
								lowercase_			 = input_mask[:1, :]
								lowercase_			 = token_type_ids[:1, :]
								lowercase_			 = 1

								# first forward pass
								lowercase_			 = model(UpperCAmelCase						,       attention_mask=UpperCAmelCase						,       token_type_ids=UpperCAmelCase						,       use_cache=UpperCAmelCase  )

								lowercase_ ,	lowercase_			 = outputs.to_tuple()

								# create hypothetical next token and extent to next_input_ids
								lowercase_			 = ids_tensor((self.batch_size, 3)						,       config.vocab_size  )
								lowercase_			 = ids_tensor((self.batch_size, 3)						,       2  )
								lowercase_			 = ids_tensor((self.batch_size, 3)						,       self.type_vocab_size  )

								# append to next input_ids and token_type_ids
								lowercase_			 = tf.concat([input_ids, next_tokens]						,       axis=-1  )
								lowercase_			 = tf.concat([input_mask, next_attn_mask]						,       axis=-1  )
								lowercase_			 = tf.concat([token_type_ids, next_token_types]						,       axis=-1  )

								lowercase_			 = model(
								    UpperCAmelCase						,       token_type_ids=UpperCAmelCase						,       attention_mask=UpperCAmelCase  )["last_hidden_state"]
								lowercase_			 = model(
								    UpperCAmelCase						,       token_type_ids=UpperCAmelCase						,       attention_mask=UpperCAmelCase						,       past_key_values=UpperCAmelCase						,       )["last_hidden_state"]
								self.parent.assertTrue(output_from_past.shape[1] == next_tokens.shape[1]  )

								# select random slice
								lowercase_			 = int(ids_tensor((1,)						,       shape_list(UpperCAmelCase  )[-1]  )  )
								lowercase_			 = output_from_no_past[:, -3:, random_slice_idx]
								lowercase_			 = output_from_past[:, :, random_slice_idx]

								# test that outputs are equal for slice
								tf.debugging.assert_near(UpperCAmelCase						,       UpperCAmelCase						,       rtol=1e-3  )




							def 				A__      (  self						,       UpperCAmelCase						,       UpperCAmelCase						,       UpperCAmelCase						,       UpperCAmelCase						,       UpperCAmelCase						,       *UpperCAmelCase  )     ->       int:






								'''simple docstring'''






								lowercase_			 = TFGPTJForCausalLM(config=UpperCAmelCase  )
								lowercase_			 = {
								    "input_ids": input_ids,
								    "attention_mask": input_mask,
								    "token_type_ids": token_type_ids,
								}
								lowercase_			 = model(UpperCAmelCase  )
								self.parent.assertEqual(result.logits.shape						,       (self.batch_size, self.seq_length, self.vocab_size)  )




							def 				A__      (  self  )     ->       str:






								'''simple docstring'''






								lowercase_			 = self.prepare_config_and_inputs()

								(
								    (
								    lowercase_
								) ,	(
								    lowercase_
								) ,	(
								    lowercase_
								) ,	(
								    lowercase_
								) ,	(
								    lowercase_
								) ,	(
								    lowercase_
								) ,	(
								    lowercase_
								) ,	(
								    lowercase_
								) ,	(
								    lowercase_
								) ,	
								)			 = config_and_inputs

								lowercase_			 = {
								    "input_ids": input_ids,
								    "token_type_ids": token_type_ids,
								    "attention_mask": input_mask,
								}
								return config, inputs_dict







@require_tf
class     __lowerCamelCase     (  snake_case_							,   snake_case_							,   snake_case_							,   unittest.TestCase     ):


							"""simple docstring"""

							lowerCAmelCase__          =				(
							    (TFGPTJForCausalLM, TFGPTJForSequenceClassification, TFGPTJForQuestionAnswering, TFGPTJModel)
							    if is_tf_available()
							    else ()
							)

							lowerCAmelCase__          =				(TFGPTJForCausalLM,) if is_tf_available() else ()
							lowerCAmelCase__          =				(
							    {
							        "feature-extraction": TFGPTJModel,
							        "question-answering": TFGPTJForQuestionAnswering,
							        "text-classification": TFGPTJForSequenceClassification,
							        "text-generation": TFGPTJForCausalLM,
							        "zero-shot": TFGPTJForSequenceClassification,
							    }
							    if is_tf_available()
							    else {}
							)
							lowerCAmelCase__          =				False
							lowerCAmelCase__          =				False
							lowerCAmelCase__          =				False
							lowerCAmelCase__          =				False




							def 				A__      (  self						,       UpperCAmelCase						,       UpperCAmelCase						,       UpperCAmelCase						,       UpperCAmelCase						,       UpperCAmelCase  )     ->       Optional[Any]:






								'''simple docstring'''






								if (
								    pipeline_test_casse_name == "QAPipelineTests"
								    and tokenizer_name is not None
								    and not tokenizer_name.endswith("Fast"  )
								):
									# `QAPipelineTests` fails for a few models when the slower tokenizer are used.
									# (The slower tokenizers were never used for pipeline tests before the pipeline testing rework)
									# TODO: check (and possibly fix) the `QAPipelineTests` with slower tokenizer
									return True

								return False




							def 				A__      (  self  )     ->       Any:






								'''simple docstring'''






								lowercase_			 = TFGPTJModelTester(self  )
								lowercase_			 = ConfigTester(self						,       config_class=UpperCAmelCase						,       n_embd=37  )




							def 				A__      (  self  )     ->       Optional[int]:






								'''simple docstring'''






								self.config_tester.run_common_tests()




							def 				A__      (  self  )     ->       str:






								'''simple docstring'''






								lowercase_			 = self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_gptj_model(*UpperCAmelCase  )




							def 				A__      (  self  )     ->       int:






								'''simple docstring'''






								lowercase_			 = self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_gptj_model_past(*UpperCAmelCase  )




							def 				A__      (  self  )     ->       str:






								'''simple docstring'''






								lowercase_			 = self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_gptj_model_attention_mask_past(*UpperCAmelCase  )




							def 				A__      (  self  )     ->       Tuple:






								'''simple docstring'''






								lowercase_			 = self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_gptj_model_past_large_inputs(*UpperCAmelCase  )




							def 				A__      (  self  )     ->       List[Any]:






								'''simple docstring'''






								lowercase_			 = self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_gptj_lm_head_model(*UpperCAmelCase  )




							@slow
							@unittest.skipIf(
							    not is_tf_available() or len(tf.config.list_physical_devices("GPU"  )  ) > 0						,       "skip testing on GPU for now to avoid GPU OOM."						,       )
							def 				A__      (  self  )     ->       Dict:






								'''simple docstring'''






								lowercase_			 = TFGPTJModel.from_pretrained("EleutherAI/gpt-j-6B"						,       from_pt=UpperCAmelCase  )
								self.assertIsNotNone(UpperCAmelCase  )




							@unittest.skip(reason="Currently, model embeddings are going to undergo a major refactor."  )
							def 				A__      (  self  )     ->       Optional[Any]:






								'''simple docstring'''






								super().test_resize_token_embeddings()







@require_tf
@tooslow
# Marked as @tooslow due to GPU OOM -- but still useful to run locally. Requires ~39GB of RAM.
class     __lowerCamelCase     (  unittest.TestCase     ):


							"""simple docstring"""

							def 				A__      (  self  )     ->       Any:






								'''simple docstring'''






								lowercase_			 = TFGPTJForCausalLM.from_pretrained("EleutherAI/gpt-j-6B"						,       from_pt=UpperCAmelCase  )
								lowercase_			 = tf.convert_to_tensor([[464, 3290]]						,       dtype=tf.intaa  )  # The dog
								# fmt: off
								# The dog is a man's best friend. It is a loyal companion, and it is a friend
								lowercase_			 = [464, 3290, 318, 257, 582, 338, 1266, 1545, 13, 632, 318, 257, 9112, 15185, 11, 290, 340, 318, 257, 1545]
								# fmt: on
								lowercase_			 = model.generate(UpperCAmelCase						,       do_sample=UpperCAmelCase  )
								self.assertListEqual(output_ids[0].numpy().tolist()						,       UpperCAmelCase  )




							def 				A__      (  self  )     ->       Any:






								'''simple docstring'''






								lowercase_			 = AutoTokenizer.from_pretrained("EleutherAI/gpt-j-6B"						,       revision="float16"  )
								lowercase_			 = TFGPTJForCausalLM.from_pretrained("EleutherAI/gpt-j-6B"						,       revision="float16"						,       from_pt=UpperCAmelCase  )

								lowercase_			 = tokenizer("Today is a nice day and"						,       return_tensors="tf"  )
								# forces the generation to happen on CPU, to avoid GPU-related quirks
								with tf.device(":/CPU:0"  ):
									lowercase_			 = model.generate(**UpperCAmelCase						,       do_sample=UpperCAmelCase						,       seed=[42, 0]  )
								lowercase_			 = tokenizer.decode(output_ids[0]						,       skip_special_tokens=UpperCAmelCase  )

								lowercase_			 = "Today is a nice day and I’m going to go for a walk. I’"
								self.assertEqual(UpperCAmelCase						,       UpperCAmelCase  )




							def 				A__      (  self  )     ->       Tuple:






								'''simple docstring'''






								lowercase_			 = TFGPTJForCausalLM.from_pretrained("EleutherAI/gpt-j-6B"						,       revision="float16"						,       from_pt=UpperCAmelCase  )
								lowercase_			 = AutoTokenizer.from_pretrained("EleutherAI/gpt-j-6B"						,       revision="float16"  )

								lowercase_			 = "left"

								# Define PAD Token = EOS Token = 50256
								lowercase_			 = tokenizer.eos_token
								lowercase_			 = model.config.eos_token_id

								# use different length sentences to test batching
								lowercase_			 = [
								    "Hello, my dog is a little",
								    "Today, I",
								]
								lowercase_			 = [
								    "Hello, my dog is a little over a year old and has been diagnosed with hip dysplasia",
								    "Today, I’m going to be talking about a topic that’",
								]
								return model, tokenizer, sentences, expected_output_sentences




							def 				A__      (  self  )     ->       int:






								'''simple docstring'''






								lowercase_ ,	lowercase_ ,	lowercase_ ,	lowercase_			 = self._get_beam_search_test_objects()

								lowercase_			 = tokenizer(UpperCAmelCase						,       return_tensors="tf"						,       padding=UpperCAmelCase  )
								lowercase_			 = model.generate(**UpperCAmelCase						,       do_sample=UpperCAmelCase						,       num_beams=2  )
								lowercase_			 = tokenizer.batch_decode(UpperCAmelCase						,       skip_special_tokens=UpperCAmelCase  )
								self.assertListEqual(UpperCAmelCase						,       UpperCAmelCase  )




							def 				A__      (  self  )     ->       Optional[int]:






								'''simple docstring'''






								lowercase_ ,	lowercase_ ,	lowercase_ ,	lowercase_			 = self._get_beam_search_test_objects()

								lowercase_			 = tokenizer(UpperCAmelCase						,       return_tensors="tf"						,       padding=UpperCAmelCase  )
								lowercase_			 = tokenizer(sentences[0]						,       return_tensors="tf"  )
								lowercase_			 = model.generate(**UpperCAmelCase						,       do_sample=UpperCAmelCase						,       num_beams=2  )
								lowercase_			 = (
								    shape_list(inputs_non_padded["input_ids"]  )[-1]
								    - tf.reduce_sum(tf.cast(inputs["attention_mask"][-1]						,       tf.intaa  )  ).numpy()
								)
								lowercase_			 = tokenizer(sentences[1]						,       return_tensors="tf"  )
								lowercase_			 = model.generate(
								    **UpperCAmelCase						,       do_sample=UpperCAmelCase						,       num_beams=2						,       max_length=model.config.max_length - num_paddings  )
								lowercase_			 = tokenizer.decode(output_non_padded[0]						,       skip_special_tokens=UpperCAmelCase  )
								lowercase_			 = tokenizer.decode(output_padded[0]						,       skip_special_tokens=UpperCAmelCase  )
								self.assertListEqual(UpperCAmelCase						,       [non_padded_sentence, padded_sentence]  )




							def 				A__      (  self  )     ->       Union[str, Any]:






								'''simple docstring'''






								lowercase_ ,	lowercase_ ,	lowercase_ ,	lowercase_			 = self._get_beam_search_test_objects()

								lowercase_			 = tokenizer(UpperCAmelCase						,       return_tensors="tf"						,       padding=UpperCAmelCase  )
								lowercase_			 = tf.function(model.generate						,       jit_compile=UpperCAmelCase  )
								lowercase_			 = xla_generate(**UpperCAmelCase						,       do_sample=UpperCAmelCase						,       num_beams=2  )
								lowercase_			 = tokenizer.batch_decode(UpperCAmelCase						,       skip_special_tokens=UpperCAmelCase  )
								self.assertListEqual(UpperCAmelCase						,       UpperCAmelCase  )





from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tokenizers_available, is_torch_available


SCREAMING_SNAKE_CASE__       			=				{
    """configuration_markuplm""": ["""MARKUPLM_PRETRAINED_CONFIG_ARCHIVE_MAP""", """MarkupLMConfig"""],
    """feature_extraction_markuplm""": ["""MarkupLMFeatureExtractor"""],
    """processing_markuplm""": ["""MarkupLMProcessor"""],
    """tokenization_markuplm""": ["""MarkupLMTokenizer"""],
}

try:
							if not is_tokenizers_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							SCREAMING_SNAKE_CASE__       			=				["""MarkupLMTokenizerFast"""]

try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							SCREAMING_SNAKE_CASE__       			=				[
							    """MARKUPLM_PRETRAINED_MODEL_ARCHIVE_LIST""",
							    """MarkupLMForQuestionAnswering""",
							    """MarkupLMForSequenceClassification""",
							    """MarkupLMForTokenClassification""",
							    """MarkupLMModel""",
							    """MarkupLMPreTrainedModel""",
							]


if TYPE_CHECKING:
							from .configuration_markuplm import MARKUPLM_PRETRAINED_CONFIG_ARCHIVE_MAP, MarkupLMConfig
							from .feature_extraction_markuplm import MarkupLMFeatureExtractor
							from .processing_markuplm import MarkupLMProcessor
							from .tokenization_markuplm import MarkupLMTokenizer

							try:
														if not is_tokenizers_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .tokenization_markuplm_fast import MarkupLMTokenizerFast

							try:
														if not is_torch_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_markuplm import (
														    MARKUPLM_PRETRAINED_MODEL_ARCHIVE_LIST,
														    MarkupLMForQuestionAnswering,
														    MarkupLMForSequenceClassification,
														    MarkupLMForTokenClassification,
														    MarkupLMModel,
														    MarkupLMPreTrainedModel,
														)


else:
							import sys

							SCREAMING_SNAKE_CASE__       			=				_LazyModule(__name__, globals()["""__file__"""], _import_structure)

