




"""simple docstring"""







import unittest

from transformers import PegasusTokenizer, PegasusTokenizerFast
from transformers.testing_utils import get_tests_dir, require_sentencepiece, require_tokenizers, require_torch, slow
from transformers.utils import cached_property

from ...test_tokenization_common import TokenizerTesterMixin


__A   :  str					=      get_tests_dir('fixtures/test_sentencepiece_no_bos.model')




@require_sentencepiece
@require_tokenizers
class       lowerCAmelCase__       (			lowerCAmelCase_  ,			unittest.TestCase    ):


				"""simple docstring"""





				__UpperCAmelCase :     str       =      PegasusTokenizer
				__UpperCAmelCase :     List[Any]       =      PegasusTokenizerFast
				__UpperCAmelCase :     Union[str, Any]       =      True
				__UpperCAmelCase :     Dict       =      True



				def       snake_case    (     self					:	Union[str, Any]						):
						super().setUp()

						# We have a SentencePiece fixture for testing
						__lowercase				:		Any												=				PegasusTokenizer(lowercase__						)
						tokenizer.save_pretrained(self.tmpdirname						)



				@cached_property
				def       snake_case    (     self					:	List[str]						):
						return PegasusTokenizer.from_pretrained("google/pegasus-large"						)



				def       snake_case    (     self					:	int    ,   **lowercase__					:	Optional[int]						):
						return PegasusTokenizer.from_pretrained(self.tmpdirname    ,   **lowercase__						)



				def       snake_case    (     self					:	List[str]    ,   lowercase__					:	List[Any]						):
						return ("This is a test", "This is a test")



				def       snake_case    (     self					:	Dict						):
						__lowercase				:		int												=				"</s>"
						__lowercase				:		Union[str, Any]												=				1

						self.assertEqual(self.get_tokenizer()._convert_token_to_id(lowercase__						)    ,   lowercase__						)
						self.assertEqual(self.get_tokenizer()._convert_id_to_token(lowercase__						)    ,   lowercase__						)



				def       snake_case    (     self					:	str						):
						__lowercase				:		str												=				list(self.get_tokenizer().get_vocab().keys()						)

						self.assertEqual(vocab_keys[0]    ,   "<pad>"						)
						self.assertEqual(vocab_keys[1]    ,   "</s>"						)
						self.assertEqual(vocab_keys[-1]    ,   "v"						)
						self.assertEqual(len(lowercase__						)    ,   1_1_0_3						)



				def       snake_case    (     self					:	Dict						):
						self.assertEqual(self.get_tokenizer().vocab_size    ,   1_1_0_3						)



				def       snake_case    (     self					:	str						):
						__lowercase				:		Any												=				self.rust_tokenizer_class.from_pretrained(self.tmpdirname						)
						__lowercase				:		str												=				self.tokenizer_class.from_pretrained(self.tmpdirname						)
						__lowercase				:		List[str]												=				(
						    "Let's see which <unk> is the better <unk_token_11> one <mask_1> It seems like this <mask_2> was important"
						    " </s> <pad> <pad> <pad>"
						)
						__lowercase				:		List[str]												=				rust_tokenizer([raw_input_str]    ,   return_tensors=lowercase__    ,   add_special_tokens=lowercase__						).input_ids[0]
						__lowercase				:		Optional[Any]												=				py_tokenizer([raw_input_str]    ,   return_tensors=lowercase__    ,   add_special_tokens=lowercase__						).input_ids[0]
						self.assertListEqual(lowercase__    ,   lowercase__						)



				def       snake_case    (     self					:	Union[str, Any]						):
						__lowercase				:		Any												=				self._large_tokenizer
						# <mask_1> masks whole sentence while <mask_2> masks single word
						__lowercase				:		int												=				"<mask_1> To ensure a <mask_2> flow of bank resolutions."
						__lowercase				:		Tuple												=				[2, 4_1_3, 6_1_5, 1_1_4, 3, 1_9_7_1, 1_1_3, 1_6_7_9, 1_0_7_1_0, 1_0_7, 1]
						__lowercase				:		Dict												=				tokenizer([raw_input_str]    ,   return_tensors=lowercase__						).input_ids[0]
						self.assertListEqual(lowercase__    ,   lowercase__						)



				def       snake_case    (     self					:	Union[str, Any]						):
						__lowercase				:		str												=				self._large_tokenizer
						# The tracebacks for the following asserts are **better** without messages or self.assertEqual
						assert tokenizer.vocab_size == 9_6_1_0_3
						assert tokenizer.pad_token_id == 0
						assert tokenizer.eos_token_id == 1
						assert tokenizer.offset == 1_0_3
						assert tokenizer.unk_token_id == tokenizer.offset + 2 == 1_0_5
						assert tokenizer.unk_token == "<unk>"
						assert tokenizer.model_max_length == 1_0_2_4
						__lowercase				:		Any												=				"To ensure a smooth flow of bank resolutions."
						__lowercase				:		List[Any]												=				[4_1_3, 6_1_5, 1_1_4, 2_2_9_1, 1_9_7_1, 1_1_3, 1_6_7_9, 1_0_7_1_0, 1_0_7, 1]
						__lowercase				:		Optional[Any]												=				tokenizer([raw_input_str]    ,   return_tensors=lowercase__						).input_ids[0]
						self.assertListEqual(lowercase__    ,   lowercase__						)
						assert tokenizer.convert_ids_to_tokens([0, 1, 2, 3]						) == ["<pad>", "</s>", "<mask_1>", "<mask_2>"]



				@require_torch
				def       snake_case    (     self					:	List[str]						):
						__lowercase				:		int												=				["This is going to be way too long." * 1_5_0, "short example"]
						__lowercase				:		str												=				["not super long but more than 5 tokens", "tiny"]
						__lowercase				:		Optional[int]												=				self._large_tokenizer(lowercase__    ,   padding=lowercase__    ,   truncation=lowercase__    ,   return_tensors="pt"						)
						__lowercase				:		Union[str, Any]												=				self._large_tokenizer(
						    text_target=lowercase__    ,   max_length=5    ,   padding=lowercase__    ,   truncation=lowercase__    ,   return_tensors="pt"						)

						assert batch.input_ids.shape == (2, 1_0_2_4)
						assert batch.attention_mask.shape == (2, 1_0_2_4)
						assert targets["input_ids"].shape == (2, 5)
						assert len(lowercase__						) == 2  # input_ids, attention_mask.



				@slow
				def       snake_case    (     self					:	Any						):
						# fmt: off
						__lowercase				:		Union[str, Any]												=				{"input_ids": [[3_8_9_7_9, 1_4_3, 1_8_4_8_5, 6_0_6, 1_3_0, 2_6_6_6_9, 8_7_6_8_6, 1_2_1, 5_4_1_8_9, 1_1_2_9, 1_1_1, 2_6_6_6_9, 8_7_6_8_6, 1_2_1, 9_1_1_4, 1_4_7_8_7, 1_2_1, 1_3_2_4_9, 1_5_8, 5_9_2, 9_5_6, 1_2_1, 1_4_6_2_1, 3_1_5_7_6, 1_4_3, 6_2_6_1_3, 1_0_8, 9_6_8_8, 9_3_0, 4_3_4_3_0, 1_1_5_6_2, 6_2_6_1_3, 3_0_4, 1_0_8, 1_1_4_4_3, 8_9_7, 1_0_8, 9_3_1_4, 1_7_4_1_5, 6_3_3_9_9, 1_0_8, 1_1_4_4_3, 7_6_1_4, 1_8_3_1_6, 1_1_8, 4_2_8_4, 7_1_4_8, 1_2_4_3_0, 1_4_3, 1_4_0_0, 2_5_7_0_3, 1_5_8, 1_1_1, 4_2_8_4, 7_1_4_8, 1_1_7_7_2, 1_4_3, 2_1_2_9_7, 1_0_6_4, 1_5_8, 1_2_2, 2_0_4, 3_5_0_6, 1_7_5_4, 1_1_3_3, 1_4_7_8_7, 1_5_8_1, 1_1_5, 3_3_2_2_4, 4_4_8_2, 1_1_1, 1_3_5_5, 1_1_0, 2_9_1_7_3, 3_1_7, 5_0_8_3_3, 1_0_8, 2_0_1_4_7, 9_4_6_6_5, 1_1_1, 7_7_1_9_8, 1_0_7, 1], [1_1_0, 6_2_6_1_3, 1_1_7, 6_3_8, 1_1_2, 1_1_3_3, 1_2_1, 2_0_0_9_8, 1_3_5_5, 7_9_0_5_0, 1_3_8_7_2, 1_3_5, 1_5_9_6, 5_3_5_4_1, 1_3_5_2, 1_4_1, 1_3_0_3_9, 5_5_4_2, 1_2_4, 3_0_2, 5_1_8, 1_1_1, 2_6_8, 2_9_5_6, 1_1_5, 1_4_9, 4_4_2_7, 1_0_7, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1_3_9, 1_2_3_5, 2_7_9_9, 1_8_2_8_9, 1_7_7_8_0, 2_0_4, 1_0_9, 9_4_7_4, 1_2_9_6, 1_0_7, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], "attention_mask": [[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]}  # noqa: E501
						# fmt: on

						self.tokenizer_integration_test_util(
						    expected_encoding=lowercase__    ,   model_name="google/bigbird-pegasus-large-arxiv"    ,   revision="ba85d0851d708441f91440d509690f1ab6353415"    ,   )





@require_sentencepiece
@require_tokenizers
class       lowerCAmelCase__       (			lowerCAmelCase_  ,			unittest.TestCase    ):


				"""simple docstring"""





				__UpperCAmelCase :     Optional[int]       =      PegasusTokenizer
				__UpperCAmelCase :     List[Any]       =      PegasusTokenizerFast
				__UpperCAmelCase :     List[str]       =      True
				__UpperCAmelCase :     str       =      True



				def       snake_case    (     self					:	Tuple						):
						super().setUp()

						# We have a SentencePiece fixture for testing
						__lowercase				:		List[str]												=				PegasusTokenizer(lowercase__    ,   offset=0    ,   mask_token_sent=lowercase__    ,   mask_token="[MASK]"						)
						tokenizer.save_pretrained(self.tmpdirname						)



				@cached_property
				def       snake_case    (     self					:	str						):
						return PegasusTokenizer.from_pretrained("google/bigbird-pegasus-large-arxiv"						)



				def       snake_case    (     self					:	int    ,   **lowercase__					:	List[str]						):
						return PegasusTokenizer.from_pretrained(self.tmpdirname    ,   **lowercase__						)



				def       snake_case    (     self					:	Optional[int]    ,   lowercase__					:	str						):
						return ("This is a test", "This is a test")



				def       snake_case    (     self					:	Dict						):
						__lowercase				:		Tuple												=				self.rust_tokenizer_class.from_pretrained(self.tmpdirname						)
						__lowercase				:		Any												=				self.tokenizer_class.from_pretrained(self.tmpdirname						)
						__lowercase				:		str												=				(
						    "Let's see which <unk> is the better <unk_token> one [MASK] It seems like this [MASK] was important </s>"
						    " <pad> <pad> <pad>"
						)
						__lowercase				:		Union[str, Any]												=				rust_tokenizer([raw_input_str]    ,   return_tensors=lowercase__    ,   add_special_tokens=lowercase__						).input_ids[0]
						__lowercase				:		str												=				py_tokenizer([raw_input_str]    ,   return_tensors=lowercase__    ,   add_special_tokens=lowercase__						).input_ids[0]
						self.assertListEqual(lowercase__    ,   lowercase__						)



				@require_torch
				def       snake_case    (     self					:	List[str]						):
						__lowercase				:		Any												=				["This is going to be way too long." * 1_0_0_0, "short example"]
						__lowercase				:		Dict												=				["not super long but more than 5 tokens", "tiny"]
						__lowercase				:		List[Any]												=				self._large_tokenizer(lowercase__    ,   padding=lowercase__    ,   truncation=lowercase__    ,   return_tensors="pt"						)
						__lowercase				:		str												=				self._large_tokenizer(
						    text_target=lowercase__    ,   max_length=5    ,   padding=lowercase__    ,   truncation=lowercase__    ,   return_tensors="pt"						)

						assert batch.input_ids.shape == (2, 4_0_9_6)
						assert batch.attention_mask.shape == (2, 4_0_9_6)
						assert targets["input_ids"].shape == (2, 5)
						assert len(lowercase__						) == 2  # input_ids, attention_mask.



				def       snake_case    (     self					:	Dict						):
						__lowercase				:		int												=				(
						    "This is an example string that is used to test the original TF implementation against the HF"
						    " implementation"
						)

						__lowercase				:		List[str]												=				self._large_tokenizer(lowercase__						).input_ids

						self.assertListEqual(
						    lowercase__    ,   [1_8_2, 1_1_7, 1_4_2, 5_8_7, 4_2_1_1, 1_2_0, 1_1_7, 2_6_3, 1_1_2, 8_0_4, 1_0_9, 8_5_6, 2_5_0_1_6, 3_1_3_7, 4_6_4, 1_0_9, 2_6_9_5_5, 3_1_3_7, 1]    ,   )






"""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						)						)
