


from typing import TYPE_CHECKING

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


snake_case_						:			int													=							{
    '''configuration_xlm''': ['''XLM_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''XLMConfig''', '''XLMOnnxConfig'''],
    '''tokenization_xlm''': ['''XLMTokenizer'''],
}

try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							snake_case_						:			Optional[Any]													=							[
							    '''XLM_PRETRAINED_MODEL_ARCHIVE_LIST''',
							    '''XLMForMultipleChoice''',
							    '''XLMForQuestionAnswering''',
							    '''XLMForQuestionAnsweringSimple''',
							    '''XLMForSequenceClassification''',
							    '''XLMForTokenClassification''',
							    '''XLMModel''',
							    '''XLMPreTrainedModel''',
							    '''XLMWithLMHeadModel''',
							]

try:
							if not is_tf_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							snake_case_						:			Dict													=							[
							    '''TF_XLM_PRETRAINED_MODEL_ARCHIVE_LIST''',
							    '''TFXLMForMultipleChoice''',
							    '''TFXLMForQuestionAnsweringSimple''',
							    '''TFXLMForSequenceClassification''',
							    '''TFXLMForTokenClassification''',
							    '''TFXLMMainLayer''',
							    '''TFXLMModel''',
							    '''TFXLMPreTrainedModel''',
							    '''TFXLMWithLMHeadModel''',
							]


if TYPE_CHECKING:
							from .configuration_xlm import XLM_PRETRAINED_CONFIG_ARCHIVE_MAP, XLMConfig, XLMOnnxConfig
							from .tokenization_xlm import XLMTokenizer

							try:
														if not is_torch_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_xlm import (
														    XLM_PRETRAINED_MODEL_ARCHIVE_LIST,
														    XLMForMultipleChoice,
														    XLMForQuestionAnswering,
														    XLMForQuestionAnsweringSimple,
														    XLMForSequenceClassification,
														    XLMForTokenClassification,
														    XLMModel,
														    XLMPreTrainedModel,
														    XLMWithLMHeadModel,
														)

							try:
														if not is_tf_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_tf_xlm import (
														    TF_XLM_PRETRAINED_MODEL_ARCHIVE_LIST,
														    TFXLMForMultipleChoice,
														    TFXLMForQuestionAnsweringSimple,
														    TFXLMForSequenceClassification,
														    TFXLMForTokenClassification,
														    TFXLMMainLayer,
														    TFXLMModel,
														    TFXLMPreTrainedModel,
														    TFXLMWithLMHeadModel,
														)

else:
							import sys

							snake_case_						:			List[Any]													=							_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)



from datetime import datetime

import matplotlib.pyplot as plt
import torch







def 						lowerCamelCase(   a__):
				for param in module.parameters():
								_SCREAMING_SNAKE_CASE			  =False







def 						lowerCamelCase(   ):
				_SCREAMING_SNAKE_CASE			  ='''cuda''' if torch.cuda.is_available() else '''cpu'''
				if torch.backends.mps.is_available() and torch.backends.mps.is_built():
								_SCREAMING_SNAKE_CASE			  ='''mps'''
				if device == "mps":
								print(
								    '''WARNING: MPS currently doesn\'t seem to work, and messes up backpropagation without any visible torch'''
								    ''' errors. I recommend using CUDA on a colab notebook or CPU instead if you\'re facing inexplicable issues'''
								    ''' with generations.''')
				return device







def 						lowerCamelCase(   a__):
				_SCREAMING_SNAKE_CASE			  =plt.imshow(a__)
				fig.axes.get_xaxis().set_visible(a__)
				fig.axes.get_yaxis().set_visible(a__)
				plt.show()







def 						lowerCamelCase(   ):
				_SCREAMING_SNAKE_CASE			  =datetime.now()
				_SCREAMING_SNAKE_CASE			  =current_time.strftime('''%H:%M:%S''')
				return timestamp