from .integrations import (
    is_optuna_available,
    is_ray_available,
    is_sigopt_available,
    is_wandb_available,
    run_hp_search_optuna,
    run_hp_search_ray,
    run_hp_search_sigopt,
    run_hp_search_wandb,
)
from .trainer_utils import (
    HPSearchBackend,
    default_hp_space_optuna,
    default_hp_space_ray,
    default_hp_space_sigopt,
    default_hp_space_wandb,
)
from .utils import logging


_UpperCAmelCase          =						logging.get_logger(__name__)





class UpperCAmelCase		:


				'''simple docstring'''






				lowerCamelCase_        =   42
				lowerCamelCase_        =   None
				@staticmethod
				def     lowerCAmelCase_  (		):



						"""simple docstring"""





						raise NotImplementedError
				def     lowerCAmelCase_  (		self						,      lowercase						,      lowercase						,      lowercase						,      **lowercase   ):



						"""simple docstring"""





						raise NotImplementedError
				def     lowerCAmelCase_  (		self						,      lowercase   ):



						"""simple docstring"""





						raise NotImplementedError
				def     lowerCAmelCase_  (		self   ):



						"""simple docstring"""





						if not self.is_available():
								raise RuntimeError(
								    F'''You picked the {self.name} backend, but it is not installed. Run {self.pip_install()}.'''   )







				@classmethod
				def     lowerCAmelCase_  (		cls   ):



						"""simple docstring"""





						return F'''`pip install {cls.pip_package or cls.name}`'''





class UpperCAmelCase		(   __A    ):


				'''simple docstring'''






				lowerCamelCase_        =   '''optuna'''
				@staticmethod
				def     lowerCAmelCase_  (		):



						"""simple docstring"""





						return is_optuna_available()
				def     lowerCAmelCase_  (		self						,      lowercase						,      lowercase						,      lowercase						,      **lowercase   ):



						"""simple docstring"""





						return run_hp_search_optuna(lowercase						,      lowercase						,      lowercase						,      **lowercase   )







				def     lowerCAmelCase_  (		self						,      lowercase   ):



						"""simple docstring"""





						return default_hp_space_optuna(lowercase   )





class UpperCAmelCase		(   __A    ):


				'''simple docstring'''






				lowerCamelCase_        =   '''ray'''
				lowerCamelCase_        =   '''\'ray[tune]\''''
				@staticmethod
				def     lowerCAmelCase_  (		):



						"""simple docstring"""





						return is_ray_available()
				def     lowerCAmelCase_  (		self						,      lowercase						,      lowercase						,      lowercase						,      **lowercase   ):



						"""simple docstring"""





						return run_hp_search_ray(lowercase						,      lowercase						,      lowercase						,      **lowercase   )







				def     lowerCAmelCase_  (		self						,      lowercase   ):



						"""simple docstring"""





						return default_hp_space_ray(lowercase   )





class UpperCAmelCase		(   __A    ):


				'''simple docstring'''






				lowerCamelCase_        =   '''sigopt'''
				@staticmethod
				def     lowerCAmelCase_  (		):



						"""simple docstring"""





						return is_sigopt_available()
				def     lowerCAmelCase_  (		self						,      lowercase						,      lowercase						,      lowercase						,      **lowercase   ):



						"""simple docstring"""





						return run_hp_search_sigopt(lowercase						,      lowercase						,      lowercase						,      **lowercase   )







				def     lowerCAmelCase_  (		self						,      lowercase   ):



						"""simple docstring"""





						return default_hp_space_sigopt(lowercase   )





class UpperCAmelCase		(   __A    ):


				'''simple docstring'''






				lowerCamelCase_        =   '''wandb'''
				@staticmethod
				def     lowerCAmelCase_  (		):



						"""simple docstring"""





						return is_wandb_available()
				def     lowerCAmelCase_  (		self						,      lowercase						,      lowercase						,      lowercase						,      **lowercase   ):



						"""simple docstring"""





						return run_hp_search_wandb(lowercase						,      lowercase						,      lowercase						,      **lowercase   )







				def     lowerCAmelCase_  (		self						,      lowercase   ):



						"""simple docstring"""





						return default_hp_space_wandb(lowercase   )

_UpperCAmelCase          =						{
    HPSearchBackend(backend.name): backend for backend in [OptunaBackend, RayTuneBackend, SigOptBackend, WandbBackend]
}




def 							UpperCamelCase		(			):
		'''simple docstring'''




		A_						:							List[str]      = [backend for backend in ALL_HYPERPARAMETER_SEARCH_BACKENDS.values() if backend.is_available()]
		if len(__lowercase      ) > 0:
				A_						:							List[str]      = available_backends[0].name
				if len(__lowercase      ) > 1:
						logger.info(
						    f'''{len(__lowercase      )} hyperparameter search backends available. Using {name} as the default.'''      )
				return name
		raise RuntimeError(
		    'No hyperparameter search backend available.\n'
		    + '\n'.join(
		        f''' - To install {backend.name} run {backend.pip_install()}'''
		        for backend in ALL_HYPERPARAMETER_SEARCH_BACKENDS.values()      )      )







import unittest

from transformers import XLMConfig, is_torch_available
from transformers.testing_utils import require_torch, slow, torch_device

from ...generation.test_utils import GenerationTesterMixin
from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, ids_tensor, random_attention_mask
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
	import torch

	from transformers import (
	    XLMForMultipleChoice,
	    XLMForQuestionAnswering,
	    XLMForQuestionAnsweringSimple,
	    XLMForSequenceClassification,
	    XLMForTokenClassification,
	    XLMModel,
	    XLMWithLMHeadModel,
	)
	from transformers.models.xlm.modeling_xlm import XLM_PRETRAINED_MODEL_ARCHIVE_LIST





class UpperCAmelCase		:


				'''simple docstring'''






				def __init__(		self						,      lowercase						,      lowercase=1_3						,      lowercase=7						,      lowercase=True						,      lowercase=True						,      lowercase=True						,      lowercase=True						,      lowercase=True						,      lowercase=False						,      lowercase=False						,      lowercase=False						,      lowercase=2						,      lowercase=9_9						,      lowercase=0						,      lowercase=3_2						,      lowercase=5						,      lowercase=4						,      lowercase=0.1						,      lowercase=0.1						,      lowercase=5_1_2						,      lowercase=2						,      lowercase=0.02						,      lowercase=2						,      lowercase=4						,      lowercase="last"						,      lowercase=True						,      lowercase=None						,      lowercase=0						,      ):



						"""simple docstring"""





						A_						:							Optional[Any]      = parent
						A_						:							int      = batch_size
						A_						:							Tuple      = seq_length
						A_						:							List[Any]      = is_training
						A_						:							Tuple      = use_input_lengths
						A_						:							int      = use_token_type_ids
						A_						:							Optional[int]      = use_labels
						A_						:							Optional[int]      = gelu_activation
						A_						:							Dict      = sinusoidal_embeddings
						A_						:							Dict      = causal
						A_						:							Tuple      = asm
						A_						:							str      = n_langs
						A_						:							List[Any]      = vocab_size
						A_						:							Union[str, Any]      = n_special
						A_						:							Union[str, Any]      = hidden_size
						A_						:							Union[str, Any]      = num_hidden_layers
						A_						:							Optional[Any]      = num_attention_heads
						A_						:							Dict      = hidden_dropout_prob
						A_						:							Any      = attention_probs_dropout_prob
						A_						:							str      = max_position_embeddings
						A_						:							Optional[Any]      = type_sequence_label_size
						A_						:							List[Any]      = initializer_range
						A_						:							List[Any]      = num_labels
						A_						:							List[str]      = num_choices
						A_						:							Tuple      = summary_type
						A_						:							List[str]      = use_proj
						A_						:							Any      = scope
						A_						:							Any      = bos_token_id
				def     lowerCAmelCase_  (		self   ):



						"""simple docstring"""





						A_						:							List[str]      = ids_tensor([self.batch_size, self.seq_length]						,      self.vocab_size   )
						A_						:							Any      = random_attention_mask([self.batch_size, self.seq_length]   )

						A_						:							List[Any]      = None
						if self.use_input_lengths:
								A_						:							Optional[int]      = (
								    ids_tensor([self.batch_size]						,      vocab_size=2   ) + self.seq_length - 2
								)  # small variation of seq_length

						A_						:							List[Any]      = None
						if self.use_token_type_ids:
								A_						:							List[Any]      = ids_tensor([self.batch_size, self.seq_length]						,      self.n_langs   )

						A_						:							Any      = None
						A_						:							List[str]      = None
						A_						:							Optional[Any]      = None
						if self.use_labels:
								A_						:							Tuple      = ids_tensor([self.batch_size]						,      self.type_sequence_label_size   )
								A_						:							Dict      = ids_tensor([self.batch_size, self.seq_length]						,      self.num_labels   )
								A_						:							Optional[int]      = ids_tensor([self.batch_size]						,      2   ).float()
								A_						:							List[Any]      = ids_tensor([self.batch_size]						,      self.num_choices   )

						A_						:							int      = self.get_config()

						return (
						    config,
						    input_ids,
						    token_type_ids,
						    input_lengths,
						    sequence_labels,
						    token_labels,
						    is_impossible_labels,
						    choice_labels,
						    input_mask,
						)
				def     lowerCAmelCase_  (		self   ):



						"""simple docstring"""





						return XLMConfig(
						    vocab_size=self.vocab_size						,      n_special=self.n_special						,      emb_dim=self.hidden_size						,      n_layers=self.num_hidden_layers						,      n_heads=self.num_attention_heads						,      dropout=self.hidden_dropout_prob						,      attention_dropout=self.attention_probs_dropout_prob						,      gelu_activation=self.gelu_activation						,      sinusoidal_embeddings=self.sinusoidal_embeddings						,      asm=self.asm						,      causal=self.causal						,      n_langs=self.n_langs						,      max_position_embeddings=self.max_position_embeddings						,      initializer_range=self.initializer_range						,      summary_type=self.summary_type						,      use_proj=self.use_proj						,      num_labels=self.num_labels						,      bos_token_id=self.bos_token_id						,      )
				def     lowerCAmelCase_  (		self						,      lowercase						,      lowercase						,      lowercase						,      lowercase						,      lowercase						,      lowercase						,      lowercase						,      lowercase						,      lowercase						,      ):



						"""simple docstring"""





						A_						:							Union[str, Any]      = XLMModel(config=lowercase   )
						model.to(lowercase   )
						model.eval()
						A_						:							Union[str, Any]      = model(lowercase						,      lengths=lowercase						,      langs=lowercase   )
						A_						:							Any      = model(lowercase						,      langs=lowercase   )
						A_						:							Optional[int]      = model(lowercase   )
						self.parent.assertEqual(result.last_hidden_state.shape						,      (self.batch_size, self.seq_length, self.hidden_size)   )
				def     lowerCAmelCase_  (		self						,      lowercase						,      lowercase						,      lowercase						,      lowercase						,      lowercase						,      lowercase						,      lowercase						,      lowercase						,      lowercase						,      ):



						"""simple docstring"""





						A_						:							Optional[int]      = XLMWithLMHeadModel(lowercase   )
						model.to(lowercase   )
						model.eval()

						A_						:							Dict      = model(lowercase						,      token_type_ids=lowercase						,      labels=lowercase   )
						self.parent.assertEqual(result.loss.shape						,      ()   )
						self.parent.assertEqual(result.logits.shape						,      (self.batch_size, self.seq_length, self.vocab_size)   )
				def     lowerCAmelCase_  (		self						,      lowercase						,      lowercase						,      lowercase						,      lowercase						,      lowercase						,      lowercase						,      lowercase						,      lowercase						,      lowercase						,      ):



						"""simple docstring"""





						A_						:							str      = XLMForQuestionAnsweringSimple(lowercase   )
						model.to(lowercase   )
						model.eval()

						A_						:							Optional[Any]      = model(lowercase   )

						A_						:							str      = model(lowercase						,      start_positions=lowercase						,      end_positions=lowercase   )
						A_						:							int      = outputs
						self.parent.assertEqual(result.start_logits.shape						,      (self.batch_size, self.seq_length)   )
						self.parent.assertEqual(result.end_logits.shape						,      (self.batch_size, self.seq_length)   )
				def     lowerCAmelCase_  (		self						,      lowercase						,      lowercase						,      lowercase						,      lowercase						,      lowercase						,      lowercase						,      lowercase						,      lowercase						,      lowercase						,      ):



						"""simple docstring"""





						A_						:							str      = XLMForQuestionAnswering(lowercase   )
						model.to(lowercase   )
						model.eval()

						A_						:							Any      = model(lowercase   )

						A_						:							Tuple      = model(
						    lowercase						,      start_positions=lowercase						,      end_positions=lowercase						,      cls_index=lowercase						,      is_impossible=lowercase						,      p_mask=lowercase						,      )

						A_						:							Any      = model(
						    lowercase						,      start_positions=lowercase						,      end_positions=lowercase						,      cls_index=lowercase						,      is_impossible=lowercase						,      )

						((A_)  ,     )						:							Union[str, Any]      = result_with_labels.to_tuple()

						A_						:							Dict      = model(lowercase						,      start_positions=lowercase						,      end_positions=lowercase   )

						((A_)  ,     )						:							Union[str, Any]      = result_with_labels.to_tuple()

						self.parent.assertEqual(result_with_labels.loss.shape						,      ()   )
						self.parent.assertEqual(result.start_top_log_probs.shape						,      (self.batch_size, model.config.start_n_top)   )
						self.parent.assertEqual(result.start_top_index.shape						,      (self.batch_size, model.config.start_n_top)   )
						self.parent.assertEqual(
						    result.end_top_log_probs.shape						,      (self.batch_size, model.config.start_n_top * model.config.end_n_top)   )
						self.parent.assertEqual(
						    result.end_top_index.shape						,      (self.batch_size, model.config.start_n_top * model.config.end_n_top)   )
						self.parent.assertEqual(result.cls_logits.shape						,      (self.batch_size,)   )
				def     lowerCAmelCase_  (		self						,      lowercase						,      lowercase						,      lowercase						,      lowercase						,      lowercase						,      lowercase						,      lowercase						,      lowercase						,      lowercase						,      ):



						"""simple docstring"""





						A_						:							str      = XLMForSequenceClassification(lowercase   )
						model.to(lowercase   )
						model.eval()

						A_						:							Union[str, Any]      = model(lowercase   )
						A_						:							Optional[int]      = model(lowercase						,      labels=lowercase   )
						self.parent.assertEqual(result.loss.shape						,      ()   )
						self.parent.assertEqual(result.logits.shape						,      (self.batch_size, self.type_sequence_label_size)   )
				def     lowerCAmelCase_  (		self						,      lowercase						,      lowercase						,      lowercase						,      lowercase						,      lowercase						,      lowercase						,      lowercase						,      lowercase						,      lowercase						,      ):



						"""simple docstring"""





						A_						:							Optional[Any]      = self.num_labels
						A_						:							List[str]      = XLMForTokenClassification(lowercase   )
						model.to(lowercase   )
						model.eval()

						A_						:							str      = model(lowercase						,      attention_mask=lowercase						,      labels=lowercase   )
						self.parent.assertEqual(result.logits.shape						,      (self.batch_size, self.seq_length, self.num_labels)   )
				def     lowerCAmelCase_  (		self						,      lowercase						,      lowercase						,      lowercase						,      lowercase						,      lowercase						,      lowercase						,      lowercase						,      lowercase						,      lowercase						,      ):



						"""simple docstring"""





						A_						:							str      = self.num_choices
						A_						:							Optional[Any]      = XLMForMultipleChoice(config=lowercase   )
						model.to(lowercase   )
						model.eval()
						A_						:							int      = input_ids.unsqueeze(1   ).expand(-1						,      self.num_choices						,      -1   ).contiguous()
						A_						:							Tuple      = token_type_ids.unsqueeze(1   ).expand(-1						,      self.num_choices						,      -1   ).contiguous()
						A_						:							Optional[int]      = input_mask.unsqueeze(1   ).expand(-1						,      self.num_choices						,      -1   ).contiguous()
						A_						:							Tuple      = model(
						    lowercase						,      attention_mask=lowercase						,      token_type_ids=lowercase						,      labels=lowercase						,      )
						self.parent.assertEqual(result.logits.shape						,      (self.batch_size, self.num_choices)   )







				def     lowerCAmelCase_  (		self   ):



						"""simple docstring"""





						A_						:							List[str]      = self.prepare_config_and_inputs()
						(
						    (
						    A_
						)  ,     (
						    A_
						)  ,     (
						    A_
						)  ,     (
						    A_
						)  ,     (
						    A_
						)  ,     (
						    A_
						)  ,     (
						    A_
						)  ,     (
						    A_
						)  ,     (
						    A_
						)  ,     
						)						:							Any      = config_and_inputs
						A_						:							Dict      = {'input_ids': input_ids, 'token_type_ids': token_type_ids, 'lengths': input_lengths}
						return config, inputs_dict





@require_torch
class UpperCAmelCase		(   __A   ,			__A   ,			__A   ,			unittest.TestCase    ):


				'''simple docstring'''






				lowerCamelCase_        =   (
				    (
				        XLMModel,
				        XLMWithLMHeadModel,
				        XLMForQuestionAnswering,
				        XLMForSequenceClassification,
				        XLMForQuestionAnsweringSimple,
				        XLMForTokenClassification,
				        XLMForMultipleChoice,
				    )
				    if is_torch_available()
				    else ()
				)
				lowerCamelCase_        =   (
				    (XLMWithLMHeadModel,) if is_torch_available() else ()
				)  # TODO (PVP): Check other models whether language generation is also applicable
				lowerCamelCase_        =   (
				    {
				        '''feature-extraction''': XLMModel,
				        '''fill-mask''': XLMWithLMHeadModel,
				        '''question-answering''': XLMForQuestionAnsweringSimple,
				        '''text-classification''': XLMForSequenceClassification,
				        '''text-generation''': XLMWithLMHeadModel,
				        '''token-classification''': XLMForTokenClassification,
				        '''zero-shot''': XLMForSequenceClassification,
				    }
				    if is_torch_available()
				    else {}
				)
				def     lowerCAmelCase_  (		self						,      lowercase						,      lowercase						,      lowercase						,      lowercase						,      lowercase   ):



						"""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     lowerCAmelCase_  (		self						,      lowercase						,      lowercase						,      lowercase=False   ):



						"""simple docstring"""





						A_						:							Dict      = super()._prepare_for_class(lowercase						,      lowercase						,      return_labels=lowercase   )

						if return_labels:
								if model_class.__name__ == "XLMForQuestionAnswering":
										A_						:							Any      = torch.zeros(
										    self.model_tester.batch_size						,      dtype=torch.long						,      device=lowercase   )
										A_						:							int      = torch.zeros(
										    self.model_tester.batch_size						,      dtype=torch.long						,      device=lowercase   )

						return inputs_dict
				def     lowerCAmelCase_  (		self   ):



						"""simple docstring"""





						A_						:							Any      = XLMModelTester(self   )
						A_						:							Any      = ConfigTester(self						,      config_class=lowercase						,      emb_dim=3_7   )
				def     lowerCAmelCase_  (		self   ):



						"""simple docstring"""





						self.config_tester.run_common_tests()
				def     lowerCAmelCase_  (		self   ):



						"""simple docstring"""





						A_						:							Union[str, Any]      = self.model_tester.prepare_config_and_inputs()
						self.model_tester.create_and_check_xlm_model(*lowercase   )
				def     lowerCAmelCase_  (		self   ):



						"""simple docstring"""





						A_						:							Tuple      = self.model_tester.prepare_config_and_inputs()
						self.model_tester.create_and_check_xlm_lm_head(*lowercase   )
				def     lowerCAmelCase_  (		self   ):



						"""simple docstring"""





						A_						:							List[str]      = self.model_tester.prepare_config_and_inputs()
						self.model_tester.create_and_check_xlm_simple_qa(*lowercase   )
				def     lowerCAmelCase_  (		self   ):



						"""simple docstring"""





						A_						:							Union[str, Any]      = self.model_tester.prepare_config_and_inputs()
						self.model_tester.create_and_check_xlm_qa(*lowercase   )
				def     lowerCAmelCase_  (		self   ):



						"""simple docstring"""





						A_						:							Union[str, Any]      = self.model_tester.prepare_config_and_inputs()
						self.model_tester.create_and_check_xlm_sequence_classif(*lowercase   )
				def     lowerCAmelCase_  (		self   ):



						"""simple docstring"""





						A_						:							Any      = self.model_tester.prepare_config_and_inputs()
						self.model_tester.create_and_check_xlm_token_classif(*lowercase   )
				def     lowerCAmelCase_  (		self   ):



						"""simple docstring"""





						A_						:							Optional[Any]      = self.model_tester.prepare_config_and_inputs()
						self.model_tester.create_and_check_xlm_for_multiple_choice(*lowercase   )
				def     lowerCAmelCase_  (		self						,      lowercase						,      lowercase						,      lowercase						,      lowercase						,      lowercase						,      lowercase=False						,      lowercase=1   ):



						"""simple docstring"""





						self.assertIsInstance(lowercase						,      lowercase   )
						self.assertListEqual(
						    [isinstance(lowercase						,      lowercase   ) for iter_attentions in attentions]						,      [True] * len(lowercase   )   )
						self.assertEqual(len(lowercase   )						,      (max_length - min_length) * num_beam_groups   )

						for idx, iter_attentions in enumerate(lowercase   ):
								# adds PAD dummy token
								A_						:							Optional[int]      = min_length + idx + 1
								A_						:							List[str]      = min_length + idx + 1

								A_						:							str      = (
								    batch_size * num_beam_groups,
								    config.num_attention_heads,
								    tgt_len,
								    src_len,
								)
								# check attn size
								self.assertListEqual(
								    [layer_attention.shape for layer_attention in iter_attentions]						,      [expected_shape] * len(lowercase   )   )
				def     lowerCAmelCase_  (		self						,      lowercase						,      lowercase						,      lowercase						,      lowercase						,      lowercase						,      lowercase=False						,      lowercase=1   ):



						"""simple docstring"""





						self.assertIsInstance(lowercase						,      lowercase   )
						self.assertListEqual(
						    [isinstance(lowercase						,      lowercase   ) for iter_hidden_states in hidden_states]						,      [True] * len(lowercase   )						,      )
						self.assertEqual(len(lowercase   )						,      (max_length - min_length) * num_beam_groups   )

						for idx, iter_hidden_states in enumerate(lowercase   ):
								# adds PAD dummy token
								A_						:							Dict      = min_length + idx + 1
								A_						:							int      = (batch_size * num_beam_groups, seq_len, config.hidden_size)
								# check hidden size
								self.assertListEqual(
								    [layer_hidden_states.shape for layer_hidden_states in iter_hidden_states]						,      [expected_shape] * len(lowercase   )						,      )
						pass







				@slow
				def     lowerCAmelCase_  (		self   ):



						"""simple docstring"""





						for model_name in XLM_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
								A_						:							Dict      = XLMModel.from_pretrained(lowercase   )
								self.assertIsNotNone(lowercase   )





@require_torch
class UpperCAmelCase		(   unittest.TestCase    ):


				'''simple docstring'''






				@slow
				def     lowerCAmelCase_  (		self   ):



						"""simple docstring"""





						A_						:							Dict      = XLMWithLMHeadModel.from_pretrained('xlm-mlm-en-2048'   )
						model.to(lowercase   )
						A_						:							int      = torch.tensor([[1_4, 4_4_7]]						,      dtype=torch.long						,      device=lowercase   )  # the president
						A_						:							Tuple      = [
						    1_4,
						    4_4_7,
						    1_4,
						    4_4_7,
						    1_4,
						    4_4_7,
						    1_4,
						    4_4_7,
						    1_4,
						    4_4_7,
						    1_4,
						    4_4_7,
						    1_4,
						    4_4_7,
						    1_4,
						    4_4_7,
						    1_4,
						    4_4_7,
						    1_4,
						    4_4_7,
						]  # the president the president the president the president the president the president the president the president the president the president
						# TODO(PVP): this and other input_ids I tried for generation give pretty bad results. Not sure why. Model might just not be made for auto-regressive inference
						A_						:							Dict      = model.generate(lowercase						,      do_sample=lowercase   )
						self.assertListEqual(output_ids[0].cpu().numpy().tolist()						,      lowercase   )






