




"""simple docstring"""







import unittest

from transformers import SqueezeBertConfig, is_torch_available
from transformers.testing_utils import require_sentencepiece, require_tokenizers, require_torch, slow, torch_device

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 (
						    SQUEEZEBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
						    SqueezeBertForMaskedLM,
						    SqueezeBertForMultipleChoice,
						    SqueezeBertForQuestionAnswering,
						    SqueezeBertForSequenceClassification,
						    SqueezeBertForTokenClassification,
						    SqueezeBertModel,
						)




class       lowerCAmelCase__       (			lowerCAmelCase_    ):


				"""simple docstring"""





				def __init__(     self					:	Optional[int]    ,   lowercase__					:	Any    ,   lowercase__					:	List[str]=1_3    ,   lowercase__					:	List[Any]=7    ,   lowercase__					:	Optional[Any]=True    ,   lowercase__					:	str=True    ,   lowercase__					:	Any=False    ,   lowercase__					:	Dict=True    ,   lowercase__					:	Tuple=9_9    ,   lowercase__					:	Optional[int]=3_2    ,   lowercase__					:	Optional[int]=5    ,   lowercase__					:	str=4    ,   lowercase__					:	str=6_4    ,   lowercase__					:	Union[str, Any]="gelu"    ,   lowercase__					:	List[str]=0.1    ,   lowercase__					:	Union[str, Any]=0.1    ,   lowercase__					:	int=5_1_2    ,   lowercase__					:	List[str]=1_6    ,   lowercase__					:	Dict=2    ,   lowercase__					:	Optional[int]=0.0_2    ,   lowercase__					:	Any=3    ,   lowercase__					:	str=4    ,   lowercase__					:	List[Any]=None    ,   lowercase__					:	int=2    ,   lowercase__					:	Optional[Any]=2    ,   lowercase__					:	List[Any]=2    ,   lowercase__					:	Tuple=2    ,   lowercase__					:	int=4    ,   lowercase__					:	Any=1    ,   ):
						__lowercase				:		Dict												=				parent
						__lowercase				:		Union[str, Any]												=				batch_size
						__lowercase				:		List[Any]												=				seq_length
						__lowercase				:		int												=				is_training
						__lowercase				:		Dict												=				use_input_mask
						__lowercase				:		List[Any]												=				use_token_type_ids
						__lowercase				:		Tuple												=				use_labels
						__lowercase				:		List[str]												=				vocab_size
						__lowercase				:		int												=				hidden_size
						__lowercase				:		str												=				num_hidden_layers
						__lowercase				:		List[Any]												=				num_attention_heads
						__lowercase				:		Dict												=				intermediate_size
						__lowercase				:		Any												=				hidden_act
						__lowercase				:		Optional[Any]												=				hidden_dropout_prob
						__lowercase				:		Union[str, Any]												=				attention_probs_dropout_prob
						__lowercase				:		Any												=				max_position_embeddings
						__lowercase				:		Union[str, Any]												=				type_vocab_size
						__lowercase				:		Dict												=				type_sequence_label_size
						__lowercase				:		Any												=				initializer_range
						__lowercase				:		Union[str, Any]												=				num_labels
						__lowercase				:		Union[str, Any]												=				num_choices
						__lowercase				:		List[Any]												=				scope
						__lowercase				:		Tuple												=				q_groups
						__lowercase				:		Optional[int]												=				k_groups
						__lowercase				:		Any												=				v_groups
						__lowercase				:		str												=				post_attention_groups
						__lowercase				:		Optional[Any]												=				intermediate_groups
						__lowercase				:		Union[str, Any]												=				output_groups



				def       snake_case    (     self					:	Dict						):
						__lowercase				:		Optional[int]												=				ids_tensor([self.batch_size, self.seq_length]    ,   self.vocab_size						)

						__lowercase				:		Union[str, Any]												=				None
						if self.use_input_mask:
								__lowercase				:		str												=				random_attention_mask([self.batch_size, self.seq_length]						)

						__lowercase				:		Union[str, Any]												=				None
						__lowercase				:		Any												=				None
						__lowercase				:		Optional[int]												=				None
						if self.use_labels:
								__lowercase				:		int												=				ids_tensor([self.batch_size]    ,   self.type_sequence_label_size						)
								__lowercase				:		Optional[Any]												=				ids_tensor([self.batch_size, self.seq_length]    ,   self.num_labels						)
								__lowercase				:		Any												=				ids_tensor([self.batch_size]    ,   self.num_choices						)

						__lowercase				:		Dict												=				self.get_config()

						return config, input_ids, input_mask, sequence_labels, token_labels, choice_labels



				def       snake_case    (     self					:	Dict						):
						return SqueezeBertConfig(
						    embedding_size=self.hidden_size    ,   vocab_size=self.vocab_size    ,   hidden_size=self.hidden_size    ,   num_hidden_layers=self.num_hidden_layers    ,   num_attention_heads=self.num_attention_heads    ,   intermediate_size=self.intermediate_size    ,   hidden_act=self.hidden_act    ,   attention_probs_dropout_prob=self.hidden_dropout_prob    ,   attention_dropout=self.attention_probs_dropout_prob    ,   max_position_embeddings=self.max_position_embeddings    ,   initializer_range=self.initializer_range    ,   q_groups=self.q_groups    ,   k_groups=self.k_groups    ,   v_groups=self.v_groups    ,   post_attention_groups=self.post_attention_groups    ,   intermediate_groups=self.intermediate_groups    ,   output_groups=self.output_groups    ,   )



				def       snake_case    (     self					:	Optional[Any]    ,   lowercase__					:	List[str]    ,   lowercase__					:	List[Any]    ,   lowercase__					:	Optional[int]    ,   lowercase__					:	List[str]    ,   lowercase__					:	str    ,   lowercase__					:	Optional[int]						):
						__lowercase				:		Tuple												=				SqueezeBertModel(config=lowercase__						)
						model.to(lowercase__						)
						model.eval()
						__lowercase				:		List[str]												=				model(lowercase__    ,   lowercase__						)
						__lowercase				:		int												=				model(lowercase__						)
						self.parent.assertEqual(result.last_hidden_state.shape    ,   (self.batch_size, self.seq_length, self.hidden_size)						)



				def       snake_case    (     self					:	List[Any]    ,   lowercase__					:	Dict    ,   lowercase__					:	Optional[int]    ,   lowercase__					:	int    ,   lowercase__					:	int    ,   lowercase__					:	Optional[int]    ,   lowercase__					:	List[str]						):
						__lowercase				:		int												=				SqueezeBertForMaskedLM(config=lowercase__						)
						model.to(lowercase__						)
						model.eval()
						__lowercase				:		List[str]												=				model(lowercase__    ,   attention_mask=lowercase__    ,   labels=lowercase__						)
						self.parent.assertEqual(result.logits.shape    ,   (self.batch_size, self.seq_length, self.vocab_size)						)



				def       snake_case    (     self					:	Any    ,   lowercase__					:	str    ,   lowercase__					:	List[str]    ,   lowercase__					:	str    ,   lowercase__					:	List[Any]    ,   lowercase__					:	Union[str, Any]    ,   lowercase__					:	Dict						):
						__lowercase				:		Dict												=				SqueezeBertForQuestionAnswering(config=lowercase__						)
						model.to(lowercase__						)
						model.eval()
						__lowercase				:		Union[str, Any]												=				model(
						    lowercase__    ,   attention_mask=lowercase__    ,   start_positions=lowercase__    ,   end_positions=lowercase__						)
						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       snake_case    (     self					:	Union[str, Any]    ,   lowercase__					:	Dict    ,   lowercase__					:	Optional[int]    ,   lowercase__					:	Union[str, Any]    ,   lowercase__					:	List[Any]    ,   lowercase__					:	int    ,   lowercase__					:	Optional[Any]						):
						__lowercase				:		Union[str, Any]												=				self.num_labels
						__lowercase				:		List[Any]												=				SqueezeBertForSequenceClassification(lowercase__						)
						model.to(lowercase__						)
						model.eval()
						__lowercase				:		Any												=				model(lowercase__    ,   attention_mask=lowercase__    ,   labels=lowercase__						)
						self.parent.assertEqual(result.logits.shape    ,   (self.batch_size, self.num_labels)						)



				def       snake_case    (     self					:	List[Any]    ,   lowercase__					:	Tuple    ,   lowercase__					:	Union[str, Any]    ,   lowercase__					:	Optional[int]    ,   lowercase__					:	Tuple    ,   lowercase__					:	Tuple    ,   lowercase__					:	Tuple						):
						__lowercase				:		Dict												=				self.num_labels
						__lowercase				:		int												=				SqueezeBertForTokenClassification(config=lowercase__						)
						model.to(lowercase__						)
						model.eval()

						__lowercase				:		Optional[Any]												=				model(lowercase__    ,   attention_mask=lowercase__    ,   labels=lowercase__						)
						self.parent.assertEqual(result.logits.shape    ,   (self.batch_size, self.seq_length, self.num_labels)						)



				def       snake_case    (     self					:	Tuple    ,   lowercase__					:	Dict    ,   lowercase__					:	Any    ,   lowercase__					:	str    ,   lowercase__					:	Dict    ,   lowercase__					:	Optional[int]    ,   lowercase__					:	Optional[int]						):
						__lowercase				:		int												=				self.num_choices
						__lowercase				:		Tuple												=				SqueezeBertForMultipleChoice(config=lowercase__						)
						model.to(lowercase__						)
						model.eval()
						__lowercase				:		int												=				input_ids.unsqueeze(1						).expand(-1    ,   self.num_choices    ,   -1						).contiguous()
						__lowercase				:		str												=				input_mask.unsqueeze(1						).expand(-1    ,   self.num_choices    ,   -1						).contiguous()
						__lowercase				:		List[str]												=				model(
						    lowercase__    ,   attention_mask=lowercase__    ,   labels=lowercase__    ,   )
						self.parent.assertEqual(result.logits.shape    ,   (self.batch_size, self.num_choices)						)



				def       snake_case    (     self					:	Dict						):
						__lowercase				:		Union[str, Any]												=				self.prepare_config_and_inputs()
						((__lowercase)						,(__lowercase)						,(__lowercase)						,(__lowercase)						,(__lowercase)						,(__lowercase))				:		List[Any]												=				config_and_inputs
						__lowercase				:		Tuple												=				{"input_ids": input_ids, "attention_mask": input_mask}
						return config, inputs_dict





@require_torch
class       lowerCAmelCase__       (			lowerCAmelCase_  ,			lowerCAmelCase_  ,			unittest.TestCase    ):


				"""simple docstring"""





				__UpperCAmelCase :     Any       =      (
				    (
				        SqueezeBertModel,
				        SqueezeBertForMaskedLM,
				        SqueezeBertForMultipleChoice,
				        SqueezeBertForQuestionAnswering,
				        SqueezeBertForSequenceClassification,
				        SqueezeBertForTokenClassification,
				    )
				    if is_torch_available()
				    else None
				)
				__UpperCAmelCase :     Optional[int]       =      (
				    {
				        "feature-extraction": SqueezeBertModel,
				        "fill-mask": SqueezeBertForMaskedLM,
				        "question-answering": SqueezeBertForQuestionAnswering,
				        "text-classification": SqueezeBertForSequenceClassification,
				        "token-classification": SqueezeBertForTokenClassification,
				        "zero-shot": SqueezeBertForSequenceClassification,
				    }
				    if is_torch_available()
				    else {}
				)
				__UpperCAmelCase :     List[str]       =      False
				__UpperCAmelCase :     Optional[Any]       =      True
				__UpperCAmelCase :     int       =      False



				def       snake_case    (     self					:	Any						):
						__lowercase				:		int												=				SqueezeBertModelTester(self						)
						__lowercase				:		int												=				ConfigTester(self    ,   config_class=lowercase__    ,   dim=3_7						)



				def       snake_case    (     self					:	Optional[int]						):
						self.config_tester.run_common_tests()



				def       snake_case    (     self					:	Dict						):
						__lowercase				:		int												=				self.model_tester.prepare_config_and_inputs()
						self.model_tester.create_and_check_squeezebert_model(*lowercase__						)



				def       snake_case    (     self					:	Optional[int]						):
						__lowercase				:		str												=				self.model_tester.prepare_config_and_inputs()
						self.model_tester.create_and_check_squeezebert_for_masked_lm(*lowercase__						)



				def       snake_case    (     self					:	Optional[Any]						):
						__lowercase				:		int												=				self.model_tester.prepare_config_and_inputs()
						self.model_tester.create_and_check_squeezebert_for_question_answering(*lowercase__						)



				def       snake_case    (     self					:	str						):
						__lowercase				:		List[str]												=				self.model_tester.prepare_config_and_inputs()
						self.model_tester.create_and_check_squeezebert_for_sequence_classification(*lowercase__						)



				def       snake_case    (     self					:	Tuple						):
						__lowercase				:		Union[str, Any]												=				self.model_tester.prepare_config_and_inputs()
						self.model_tester.create_and_check_squeezebert_for_token_classification(*lowercase__						)



				def       snake_case    (     self					:	Union[str, Any]						):
						__lowercase				:		List[Any]												=				self.model_tester.prepare_config_and_inputs()
						self.model_tester.create_and_check_squeezebert_for_multiple_choice(*lowercase__						)



				@slow
				def       snake_case    (     self					:	str						):
						for model_name in SQUEEZEBERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
								__lowercase				:		Tuple												=				SqueezeBertModel.from_pretrained(lowercase__						)
								self.assertIsNotNone(lowercase__						)





@require_sentencepiece
@require_tokenizers
@require_torch
class       lowerCAmelCase__       (			unittest.TestCase    ):


				"""simple docstring"""





				@slow
				def       snake_case    (     self					:	List[str]						):
						__lowercase				:		List[Any]												=				SqueezeBertForSequenceClassification.from_pretrained("squeezebert/squeezebert-mnli"						)

						__lowercase				:		Tuple												=				torch.tensor([[1, 2_9_4_1_4, 2_3_2, 3_2_8, 7_4_0, 1_1_4_0, 1_2_6_9_5, 6_9, 1_3, 1_5_8_8, 2]]						)
						__lowercase				:		List[str]												=				model(lowercase__						)[0]
						__lowercase				:		List[str]												=				torch.Size((1, 3)						)
						self.assertEqual(output.shape    ,   lowercase__						)
						__lowercase				:		Tuple												=				torch.tensor([[0.6_4_0_1, -0.0_3_4_9, -0.6_0_4_1]]						)
						self.assertTrue(torch.allclose(lowercase__    ,   lowercase__    ,   atol=1e-4						)						)






"""simple docstring"""







import unittest

from transformers import EsmConfig, is_torch_available
from transformers.testing_utils import TestCasePlus, require_torch, slow, torch_device

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.models.esm.modeling_esmfold import EsmForProteinFolding




class       lowerCAmelCase__       :


				"""simple docstring"""





				def __init__(     self					:	Tuple    ,   lowercase__					:	Tuple    ,   lowercase__					:	Tuple=1_3    ,   lowercase__					:	Optional[int]=7    ,   lowercase__					:	List[str]=False    ,   lowercase__					:	Tuple=True    ,   lowercase__					:	int=False    ,   lowercase__					:	List[str]=False    ,   lowercase__					:	Optional[Any]=1_9    ,   lowercase__					:	int=3_2    ,   lowercase__					:	List[Any]=5    ,   lowercase__					:	Optional[int]=4    ,   lowercase__					:	Any=3_7    ,   lowercase__					:	Tuple="gelu"    ,   lowercase__					:	int=0.1    ,   lowercase__					:	Tuple=0.1    ,   lowercase__					:	List[Any]=5_1_2    ,   lowercase__					:	List[Any]=1_6    ,   lowercase__					:	Union[str, Any]=2    ,   lowercase__					:	List[str]=0.0_2    ,   lowercase__					:	List[Any]=3    ,   lowercase__					:	Any=4    ,   lowercase__					:	Optional[Any]=None    ,   ):
						__lowercase				:		int												=				parent
						__lowercase				:		Tuple												=				batch_size
						__lowercase				:		Optional[int]												=				seq_length
						__lowercase				:		str												=				is_training
						__lowercase				:		List[Any]												=				use_input_mask
						__lowercase				:		Any												=				use_token_type_ids
						__lowercase				:		str												=				use_labels
						__lowercase				:		Dict												=				vocab_size
						__lowercase				:		Optional[int]												=				hidden_size
						__lowercase				:		List[Any]												=				num_hidden_layers
						__lowercase				:		int												=				num_attention_heads
						__lowercase				:		Union[str, Any]												=				intermediate_size
						__lowercase				:		Dict												=				hidden_act
						__lowercase				:		Union[str, Any]												=				hidden_dropout_prob
						__lowercase				:		Optional[int]												=				attention_probs_dropout_prob
						__lowercase				:		Optional[Any]												=				max_position_embeddings
						__lowercase				:		List[str]												=				type_vocab_size
						__lowercase				:		str												=				type_sequence_label_size
						__lowercase				:		List[str]												=				initializer_range
						__lowercase				:		Optional[Any]												=				num_labels
						__lowercase				:		Tuple												=				num_choices
						__lowercase				:		Optional[Any]												=				scope



				def       snake_case    (     self					:	Optional[int]						):
						__lowercase				:		Tuple												=				ids_tensor([self.batch_size, self.seq_length]    ,   self.vocab_size						)

						__lowercase				:		Union[str, Any]												=				None
						if self.use_input_mask:
								__lowercase				:		List[str]												=				random_attention_mask([self.batch_size, self.seq_length]						)

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

						__lowercase				:		Optional[Any]												=				self.get_config()

						return config, input_ids, input_mask, sequence_labels, token_labels, choice_labels



				def       snake_case    (     self					:	Any						):
						__lowercase				:		Dict												=				EsmConfig(
						    vocab_size=3_3    ,   hidden_size=self.hidden_size    ,   pad_token_id=1    ,   num_hidden_layers=self.num_hidden_layers    ,   num_attention_heads=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    ,   max_position_embeddings=self.max_position_embeddings    ,   type_vocab_size=self.type_vocab_size    ,   initializer_range=self.initializer_range    ,   is_folding_model=lowercase__    ,   esmfold_config={"trunk": {"num_blocks": 2}, "fp16_esm": False}    ,   )
						return config



				def       snake_case    (     self					:	str    ,   lowercase__					:	List[Any]    ,   lowercase__					:	Optional[int]    ,   lowercase__					:	List[Any]    ,   lowercase__					:	int    ,   lowercase__					:	List[Any]    ,   lowercase__					:	str						):
						__lowercase				:		List[Any]												=				EsmForProteinFolding(config=lowercase__						).float()
						model.to(lowercase__						)
						model.eval()
						__lowercase				:		List[str]												=				model(lowercase__    ,   attention_mask=lowercase__						)
						__lowercase				:		Any												=				model(lowercase__						)
						__lowercase				:		Any												=				model(lowercase__						)

						self.parent.assertEqual(result.positions.shape    ,   (8, self.batch_size, self.seq_length, 1_4, 3)						)
						self.parent.assertEqual(result.angles.shape    ,   (8, self.batch_size, self.seq_length, 7, 2)						)



				def       snake_case    (     self					:	Tuple						):
						__lowercase				:		List[str]												=				self.prepare_config_and_inputs()
						(
						    (
						    __lowercase
						)						,(
						    __lowercase
						)						,(
						    __lowercase
						)						,(
						    __lowercase
						)						,(
						    __lowercase
						)						,(
						    __lowercase
						)						,
						)				:		Any												=				config_and_inputs
						__lowercase				:		int												=				{"input_ids": input_ids, "attention_mask": input_mask}
						return config, inputs_dict





@require_torch
class       lowerCAmelCase__       (			lowerCAmelCase_  ,			lowerCAmelCase_  ,			unittest.TestCase    ):


				"""simple docstring"""





				__UpperCAmelCase :     Union[str, Any]       =      False

				__UpperCAmelCase :     List[Any]       =      (EsmForProteinFolding,) if is_torch_available() else ()
				__UpperCAmelCase :     int       =      ()
				__UpperCAmelCase :     Tuple       =      {} if is_torch_available() else {}
				__UpperCAmelCase :     Optional[Any]       =      False



				def       snake_case    (     self					:	Tuple						):
						__lowercase				:		Tuple												=				EsmFoldModelTester(self						)
						__lowercase				:		Dict												=				ConfigTester(self    ,   config_class=lowercase__    ,   hidden_size=3_7						)



				def       snake_case    (     self					:	Dict						):
						self.config_tester.run_common_tests()



				def       snake_case    (     self					:	Optional[int]						):
						__lowercase				:		Tuple												=				self.model_tester.prepare_config_and_inputs()
						self.model_tester.create_and_check_model(*lowercase__						)



				@unittest.skip("Does not support attention outputs"						)
				def       snake_case    (     self					:	Union[str, Any]						):
						pass



				@unittest.skip
				def       snake_case    (     self					:	Tuple						):
						pass



				@unittest.skip("Esm does not support embedding resizing"						)
				def       snake_case    (     self					:	Optional[int]						):
						pass



				@unittest.skip("Esm does not support embedding resizing"						)
				def       snake_case    (     self					:	List[str]						):
						pass



				@unittest.skip("ESMFold does not support passing input embeds!"						)
				def       snake_case    (     self					:	int						):
						pass



				@unittest.skip("ESMFold does not support head pruning."						)
				def       snake_case    (     self					:	List[Any]						):
						pass



				@unittest.skip("ESMFold does not support head pruning."						)
				def       snake_case    (     self					:	Any						):
						pass



				@unittest.skip("ESMFold does not support head pruning."						)
				def       snake_case    (     self					:	Optional[Any]						):
						pass



				@unittest.skip("ESMFold does not support head pruning."						)
				def       snake_case    (     self					:	List[str]						):
						pass



				@unittest.skip("ESMFold does not support head pruning."						)
				def       snake_case    (     self					:	List[str]						):
						pass



				@unittest.skip("ESMFold does not output hidden states in the normal way."						)
				def       snake_case    (     self					:	Optional[Any]						):
						pass



				@unittest.skip("ESMfold does not output hidden states in the normal way."						)
				def       snake_case    (     self					:	Optional[Any]						):
						pass



				@unittest.skip("ESMFold only has one output format."						)
				def       snake_case    (     self					:	Tuple						):
						pass



				@unittest.skip("This test doesn't work for ESMFold and doesn't test core functionality"						)
				def       snake_case    (     self					:	Any						):
						pass



				@unittest.skip("ESMFold does not support input chunking."						)
				def       snake_case    (     self					:	str						):
						pass



				@unittest.skip("ESMFold doesn't respect you and it certainly doesn't respect your initialization arguments."						)
				def       snake_case    (     self					:	Any						):
						pass



				@unittest.skip("ESMFold doesn't support torchscript compilation."						)
				def       snake_case    (     self					:	Any						):
						pass



				@unittest.skip("ESMFold doesn't support torchscript compilation."						)
				def       snake_case    (     self					:	Tuple						):
						pass



				@unittest.skip("ESMFold doesn't support torchscript compilation."						)
				def       snake_case    (     self					:	List[str]						):
						pass



				@unittest.skip("ESMFold doesn't support data parallel."						)
				def       snake_case    (     self					:	Optional[Any]						):
						pass



				@unittest.skip("Will be fixed soon by reducing the size of the model used for common tests."						)
				def       snake_case    (     self					:	Any						):
						pass





@require_torch
class       lowerCAmelCase__       (			lowerCAmelCase_    ):


				"""simple docstring"""





				@slow
				def       snake_case    (     self					:	Union[str, Any]						):
						__lowercase				:		Tuple												=				EsmForProteinFolding.from_pretrained("facebook/esmfold_v1"						).float()
						model.eval()
						__lowercase				:		Optional[int]												=				torch.tensor([[0, 6, 4, 1_3, 5, 4, 1_6, 1_2, 1_1, 7, 2]]						)
						__lowercase				:		str												=				model(lowercase__						)["positions"]
						__lowercase				:		Union[str, Any]												=				torch.tensor([2.5_8_2_8, 0.7_9_9_3, -1_0.9_3_3_4]    ,   dtype=torch.floataa						)
						self.assertTrue(torch.allclose(position_outputs[0, 0, 0, 0]    ,   lowercase__    ,   atol=1e-4						)						)
