

import tempfile
import unittest
from pathlib import Path
from shutil import copyfile

from transformers import BatchEncoding, MarianTokenizer
from transformers.testing_utils import get_tests_dir, require_sentencepiece, slow
from transformers.utils import is_sentencepiece_available, is_tf_available, is_torch_available


if is_sentencepiece_available():
   from transformers.models.marian.tokenization_marian import VOCAB_FILES_NAMES, save_json

from ...test_tokenization_common import TokenizerTesterMixin


__UpperCAmelCase								=			get_tests_dir("""fixtures/test_sentencepiece.model""")

__UpperCAmelCase								=			{"""target_lang""": """fi""", """source_lang""": """en"""}
__UpperCAmelCase								=			""">>zh<<"""
__UpperCAmelCase								=			"""Helsinki-NLP/"""

if is_torch_available():
   __UpperCAmelCase								=			"""pt"""
elif is_tf_available():
   __UpperCAmelCase								=			"""tf"""
else:
   __UpperCAmelCase								=			"""jax"""



@require_sentencepiece
class SCREAMING_SNAKE_CASE     (  __lowercase       ,							unittest.TestCase			):
  """simple docstring"""






  lowerCamelCase   :      Dict										=MarianTokenizer
  lowerCamelCase   :      List[str]										=False
  lowerCamelCase   :      Union[str, Any]										=True







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






     """simple docstring"""







     super().setUp()
     __lowerCAmelCase  :      Dict    =						["""</s>""", """<unk>""", """▁This""", """▁is""", """▁a""", """▁t""", """est""", """\u0120""", """<pad>"""]
     __lowerCAmelCase  :      Optional[int]    =						dict(zip(UpperCAmelCase__	,							range(len(UpperCAmelCase__   )   )   )   )
     __lowerCAmelCase  :      Optional[Any]    =						Path(self.tmpdirname   )
     save_json(UpperCAmelCase__	,							save_dir / VOCAB_FILES_NAMES["""vocab"""]   )
     save_json(UpperCAmelCase__	,							save_dir / VOCAB_FILES_NAMES["""tokenizer_config_file"""]   )
     if not (save_dir / VOCAB_FILES_NAMES["source_spm"]).exists():
        copyfile(UpperCAmelCase__	,							save_dir / VOCAB_FILES_NAMES["""source_spm"""]   )
        copyfile(UpperCAmelCase__	,							save_dir / VOCAB_FILES_NAMES["""target_spm"""]   )

     __lowerCAmelCase  :      Dict    =						MarianTokenizer.from_pretrained(self.tmpdirname   )
     tokenizer.save_pretrained(self.tmpdirname   )







  def 	SCREAMING_SNAKE_CASE   (      self			:   List[str]	,							**lowerCAmelCase			:   int   )							->     MarianTokenizer:






     """simple docstring"""







     return MarianTokenizer.from_pretrained(self.tmpdirname	,							**UpperCAmelCase__   )







  def 	SCREAMING_SNAKE_CASE   (      self			:   Dict	,							lowerCAmelCase			:   Tuple   )							->     Union[str, Any]:






     """simple docstring"""







     return (
         "This is a test",
         "This is a test",
     )







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






     """simple docstring"""







     __lowerCAmelCase  :      Optional[Any]    =						"""</s>"""
     __lowerCAmelCase  :      str    =						0

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







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






     """simple docstring"""







     __lowerCAmelCase  :      Tuple    =						list(self.get_tokenizer().get_vocab().keys()   )

     self.assertEqual(vocab_keys[0]	,							"""</s>"""   )
     self.assertEqual(vocab_keys[1]	,							"""<unk>"""   )
     self.assertEqual(vocab_keys[-1]	,							"""<pad>"""   )
     self.assertEqual(len(UpperCAmelCase__   )	,							9   )







  def 	SCREAMING_SNAKE_CASE   (      self			:   List[Any]   )							->     str:






     """simple docstring"""







     self.assertEqual(self.get_tokenizer().vocab_size	,							9   )







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






     """simple docstring"""







     __lowerCAmelCase  :      Optional[int]    =						MarianTokenizer.from_pretrained(f'''{ORG_NAME}opus-mt-en-de'''   )
     __lowerCAmelCase  :      Dict    =						en_de_tokenizer(["""I am a small frog"""]	,							return_tensors=UpperCAmelCase__   )
     self.assertIsInstance(UpperCAmelCase__	,							UpperCAmelCase__   )
     __lowerCAmelCase  :      List[str]    =						[38, 1_21, 14, 6_97, 3_88_48, 0]
     self.assertListEqual(UpperCAmelCase__	,							batch.input_ids[0]   )

     __lowerCAmelCase  :      List[str]    =						tempfile.mkdtemp()
     en_de_tokenizer.save_pretrained(UpperCAmelCase__   )
     __lowerCAmelCase  :      Optional[int]    =						[x.name for x in Path(UpperCAmelCase__   ).glob("""*"""   )]
     self.assertIn("""source.spm"""	,							UpperCAmelCase__   )
     MarianTokenizer.from_pretrained(UpperCAmelCase__   )







  def 	SCREAMING_SNAKE_CASE   (      self			:   Optional[int]   )							->     List[Any]:






     """simple docstring"""







     __lowerCAmelCase  :      Optional[Any]    =						self.get_tokenizer()

     __lowerCAmelCase  :      Any    =						tok(
         ["""I am a small frog""" * 10_00, """I am a small frog"""]	,							padding=UpperCAmelCase__	,							truncation=UpperCAmelCase__	,							return_tensors=UpperCAmelCase__   )
     self.assertIsInstance(UpperCAmelCase__	,							UpperCAmelCase__   )
     self.assertEqual(batch.input_ids.shape	,							(2, 5_12)   )







  def 	SCREAMING_SNAKE_CASE   (      self			:   Tuple   )							->     List[str]:






     """simple docstring"""







     __lowerCAmelCase  :      Optional[Any]    =						self.get_tokenizer()
     __lowerCAmelCase  :      str    =						tok(["""I am a tiny frog""", """I am a small frog"""]	,							padding=UpperCAmelCase__	,							return_tensors=UpperCAmelCase__   )
     self.assertIsInstance(UpperCAmelCase__	,							UpperCAmelCase__   )
     self.assertEqual(batch_smaller.input_ids.shape	,							(2, 10)   )







  @slow
  def 	SCREAMING_SNAKE_CASE   (      self			:   List[str]   )							->     List[str]:






     """simple docstring"""







     __lowerCAmelCase  :      Tuple    =						{"""input_ids""": [[4_34_95, 4_62, 20, 4_21_64, 13_69, 52, 4_64, 1_32, 17_03, 4_92, 13, 74_91, 3_89_99, 6, 8, 4_64, 1_32, 17_03, 4_92, 13, 46_69, 3_78_67, 13, 75_25, 27, 15_93, 9_88, 13, 3_39_72, 70_29, 6, 20, 82_51, 3_83, 2, 2_70, 58_66, 37_88, 2, 23_53, 82_51, 1_23_38, 2, 1_39_58, 3_87, 2, 36_29, 69_53, 1_88, 29_00, 2, 1_39_58, 80_11, 1_15_01, 23, 84_60, 40_73, 3_40_09, 20, 4_35, 1_14_39, 27, 8, 84_60, 40_73, 60_04, 20, 99_88, 3_75, 27, 33, 2_66, 19_45, 10_76, 13_50, 3_78_67, 32_88, 5, 5_77, 10_76, 43_74, 8, 50_82, 5, 2_64_53, 2_57, 5_56, 4_03, 2, 2_42, 1_32, 3_83, 3_16, 4_92, 8, 1_07_67, 6, 3_16, 3_04, 42_39, 3, 0], [1_48, 1_57_22, 19, 18_39, 12, 13_50, 13, 2_23_27, 50_82, 54_18, 4_75_67, 3_59_38, 59, 3_18, 1_95_52, 1_08, 21_83, 54, 1_49_76, 48_35, 32, 5_47, 11_14, 8, 3_15, 24_17, 5, 92, 1_90_88, 3, 0, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00], [36, 63_95, 1_25_70, 3_91_47, 1_15_97, 6, 2_66, 4, 4_54_05, 72_96, 3, 0, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00, 5_81_00]], """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, 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, 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, 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, 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=UpperCAmelCase__	,							model_name="""Helsinki-NLP/opus-mt-en-de"""	,							revision="""1a8c2263da11e68e50938f97e10cd57820bd504c"""	,							decode_kwargs={"""use_source_tokenizer""": True}	,							)







  def 	SCREAMING_SNAKE_CASE   (      self			:   List[Any]   )							->     Optional[Any]:






     """simple docstring"""







     __lowerCAmelCase  :      str    =						MarianTokenizer.from_pretrained("""hf-internal-testing/test-marian-two-vocabs"""   )

     __lowerCAmelCase  :      List[Any]    =						"""Tämä on testi"""
     __lowerCAmelCase  :      List[str]    =						"""This is a test"""

     __lowerCAmelCase  :      Union[str, Any]    =						[76, 7, 20_47, 2]
     __lowerCAmelCase  :      Optional[Any]    =						[69, 12, 11, 9_40, 2]

     __lowerCAmelCase  :      Optional[Any]    =						tokenizer(UpperCAmelCase__   ).input_ids
     self.assertListEqual(UpperCAmelCase__	,							UpperCAmelCase__   )

     __lowerCAmelCase  :      List[Any]    =						tokenizer(text_target=UpperCAmelCase__   ).input_ids
     self.assertListEqual(UpperCAmelCase__	,							UpperCAmelCase__   )

     __lowerCAmelCase  :      List[Any]    =						tokenizer.decode(UpperCAmelCase__	,							skip_special_tokens=UpperCAmelCase__   )
     self.assertEqual(UpperCAmelCase__	,							UpperCAmelCase__   )





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 SCREAMING_SNAKE_CASE     :
  """simple docstring"""






  def __init__(      self			:   Any	,							lowerCAmelCase			:   str	,							lowerCAmelCase			:   List[Any]=13	,							lowerCAmelCase			:   List[str]=7	,							lowerCAmelCase			:   int=False	,							lowerCAmelCase			:   List[str]=True	,							lowerCAmelCase			:   List[Any]=False	,							lowerCAmelCase			:   List[str]=False	,							lowerCAmelCase			:   Optional[int]=19	,							lowerCAmelCase			:   Any=32	,							lowerCAmelCase			:   int=5	,							lowerCAmelCase			:   Optional[Any]=4	,							lowerCAmelCase			:   Optional[Any]=37	,							lowerCAmelCase			:   Dict="gelu"	,							lowerCAmelCase			:   Dict=0.1	,							lowerCAmelCase			:   Dict=0.1	,							lowerCAmelCase			:   List[str]=5_12	,							lowerCAmelCase			:   Dict=16	,							lowerCAmelCase			:   List[Any]=2	,							lowerCAmelCase			:   Union[str, Any]=0.02	,							lowerCAmelCase			:   Dict=3	,							lowerCAmelCase			:   List[Any]=4	,							lowerCAmelCase			:   Union[str, Any]=None	,							)							->     List[str]:






     """simple docstring"""







     __lowerCAmelCase  :      List[str]    =						parent
     __lowerCAmelCase  :      Tuple    =						batch_size
     __lowerCAmelCase  :      Union[str, Any]    =						seq_length
     __lowerCAmelCase  :      int    =						is_training
     __lowerCAmelCase  :      Dict    =						use_input_mask
     __lowerCAmelCase  :      Dict    =						use_token_type_ids
     __lowerCAmelCase  :      Optional[int]    =						use_labels
     __lowerCAmelCase  :      str    =						vocab_size
     __lowerCAmelCase  :      Optional[int]    =						hidden_size
     __lowerCAmelCase  :      Union[str, Any]    =						num_hidden_layers
     __lowerCAmelCase  :      Union[str, Any]    =						num_attention_heads
     __lowerCAmelCase  :      Tuple    =						intermediate_size
     __lowerCAmelCase  :      List[str]    =						hidden_act
     __lowerCAmelCase  :      Optional[int]    =						hidden_dropout_prob
     __lowerCAmelCase  :      Any    =						attention_probs_dropout_prob
     __lowerCAmelCase  :      List[str]    =						max_position_embeddings
     __lowerCAmelCase  :      Any    =						type_vocab_size
     __lowerCAmelCase  :      Union[str, Any]    =						type_sequence_label_size
     __lowerCAmelCase  :      List[str]    =						initializer_range
     __lowerCAmelCase  :      int    =						num_labels
     __lowerCAmelCase  :      Tuple    =						num_choices
     __lowerCAmelCase  :      str    =						scope







  def 	SCREAMING_SNAKE_CASE   (      self			:   Dict   )							->     Tuple:






     """simple docstring"""







     __lowerCAmelCase  :      int    =						ids_tensor([self.batch_size, self.seq_length]	,							self.vocab_size   )

     __lowerCAmelCase  :      int    =						None
     if self.use_input_mask:
        __lowerCAmelCase  :      Optional[Any]    =						random_attention_mask([self.batch_size, self.seq_length]   )

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

     __lowerCAmelCase  :      Tuple    =						self.get_config()

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







  def 	SCREAMING_SNAKE_CASE   (      self			:   Optional[int]   )							->     Tuple:






     """simple docstring"""







     __lowerCAmelCase  :      Tuple    =						EsmConfig(
         vocab_size=33	,							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=lowerCAmelCase	,							esmfold_config={"""trunk""": {"""num_blocks""": 2}, """fp16_esm""": False}	,							)
     return config







  def 	SCREAMING_SNAKE_CASE   (      self			:   Union[str, Any]	,							lowerCAmelCase			:   Any	,							lowerCAmelCase			:   Union[str, Any]	,							lowerCAmelCase			:   Any	,							lowerCAmelCase			:   Dict	,							lowerCAmelCase			:   List[Any]	,							lowerCAmelCase			:   Dict   )							->     Tuple:






     """simple docstring"""







     __lowerCAmelCase  :      List[Any]    =						EsmForProteinFolding(config=lowerCAmelCase   ).float()
     model.to(lowerCAmelCase   )
     model.eval()
     __lowerCAmelCase  :      Any    =						model(lowerCAmelCase	,							attention_mask=lowerCAmelCase   )
     __lowerCAmelCase  :      str    =						model(lowerCAmelCase   )
     __lowerCAmelCase  :      Optional[int]    =						model(lowerCAmelCase   )

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







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






     """simple docstring"""







     __lowerCAmelCase  :      Optional[Any]    =						self.prepare_config_and_inputs()
     (
         (
         __lowerCAmelCase
     )   ,(
         __lowerCAmelCase
     )   ,(
         __lowerCAmelCase
     )   ,(
         __lowerCAmelCase
     )   ,(
         __lowerCAmelCase
     )   ,(
         __lowerCAmelCase
     )   ,
     )  :      Optional[int]    =						config_and_inputs
     __lowerCAmelCase  :      int    =						{"""input_ids""": input_ids, """attention_mask""": input_mask}
     return config, inputs_dict






@require_torch
class SCREAMING_SNAKE_CASE     (  a_       ,							a_       ,							unittest.TestCase			):
  """simple docstring"""






  lowerCamelCase   :      Tuple										=False

  lowerCamelCase   :      int										=(EsmForProteinFolding,) if is_torch_available() else ()
  lowerCamelCase   :      int										=()
  lowerCamelCase   :      Dict										={} if is_torch_available() else {}
  lowerCamelCase   :      str										=False







  def 	SCREAMING_SNAKE_CASE   (      self			:   int   )							->     Any:






     """simple docstring"""







     __lowerCAmelCase  :      Union[str, Any]    =						EsmFoldModelTester(self   )
     __lowerCAmelCase  :      Optional[Any]    =						ConfigTester(self	,							config_class=lowerCAmelCase	,							hidden_size=37   )







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






     """simple docstring"""







     self.config_tester.run_common_tests()







  def 	SCREAMING_SNAKE_CASE   (      self			:   str   )							->     int:






     """simple docstring"""







     __lowerCAmelCase  :      List[Any]    =						self.model_tester.prepare_config_and_inputs()
     self.model_tester.create_and_check_model(*lowerCAmelCase   )







  @unittest.skip("""Does not support attention outputs"""   )
  def 	SCREAMING_SNAKE_CASE   (      self			:   Dict   )							->     List[Any]:






     """simple docstring"""







     pass







  @unittest.skip
  def 	SCREAMING_SNAKE_CASE   (      self			:   Union[str, Any]   )							->     List[Any]:






     """simple docstring"""







     pass







  @unittest.skip("""Esm does not support embedding resizing"""   )
  def 	SCREAMING_SNAKE_CASE   (      self			:   str   )							->     Tuple:






     """simple docstring"""







     pass







  @unittest.skip("""Esm does not support embedding resizing"""   )
  def 	SCREAMING_SNAKE_CASE   (      self			:   Tuple   )							->     Union[str, Any]:






     """simple docstring"""







     pass







  @unittest.skip("""ESMFold does not support passing input embeds!"""   )
  def 	SCREAMING_SNAKE_CASE   (      self			:   List[str]   )							->     Optional[Any]:






     """simple docstring"""







     pass







  @unittest.skip("""ESMFold does not support head pruning."""   )
  def 	SCREAMING_SNAKE_CASE   (      self			:   Dict   )							->     Optional[int]:






     """simple docstring"""







     pass







  @unittest.skip("""ESMFold does not support head pruning."""   )
  def 	SCREAMING_SNAKE_CASE   (      self			:   Tuple   )							->     int:






     """simple docstring"""







     pass







  @unittest.skip("""ESMFold does not support head pruning."""   )
  def 	SCREAMING_SNAKE_CASE   (      self			:   Any   )							->     Dict:






     """simple docstring"""







     pass







  @unittest.skip("""ESMFold does not support head pruning."""   )
  def 	SCREAMING_SNAKE_CASE   (      self			:   Any   )							->     str:






     """simple docstring"""







     pass







  @unittest.skip("""ESMFold does not support head pruning."""   )
  def 	SCREAMING_SNAKE_CASE   (      self			:   List[Any]   )							->     Dict:






     """simple docstring"""







     pass







  @unittest.skip("""ESMFold does not output hidden states in the normal way."""   )
  def 	SCREAMING_SNAKE_CASE   (      self			:   Tuple   )							->     List[Any]:






     """simple docstring"""







     pass







  @unittest.skip("""ESMfold does not output hidden states in the normal way."""   )
  def 	SCREAMING_SNAKE_CASE   (      self			:   Optional[int]   )							->     List[str]:






     """simple docstring"""







     pass







  @unittest.skip("""ESMFold only has one output format."""   )
  def 	SCREAMING_SNAKE_CASE   (      self			:   Optional[int]   )							->     Union[str, Any]:






     """simple docstring"""







     pass







  @unittest.skip("""This test doesn't work for ESMFold and doesn't test core functionality"""   )
  def 	SCREAMING_SNAKE_CASE   (      self			:   Tuple   )							->     Optional[Any]:






     """simple docstring"""







     pass







  @unittest.skip("""ESMFold does not support input chunking."""   )
  def 	SCREAMING_SNAKE_CASE   (      self			:   Any   )							->     Any:






     """simple docstring"""







     pass







  @unittest.skip("""ESMFold doesn't respect you and it certainly doesn't respect your initialization arguments."""   )
  def 	SCREAMING_SNAKE_CASE   (      self			:   List[Any]   )							->     Union[str, Any]:






     """simple docstring"""







     pass







  @unittest.skip("""ESMFold doesn't support torchscript compilation."""   )
  def 	SCREAMING_SNAKE_CASE   (      self			:   int   )							->     Dict:






     """simple docstring"""







     pass







  @unittest.skip("""ESMFold doesn't support torchscript compilation."""   )
  def 	SCREAMING_SNAKE_CASE   (      self			:   Optional[Any]   )							->     Optional[Any]:






     """simple docstring"""







     pass







  @unittest.skip("""ESMFold doesn't support torchscript compilation."""   )
  def 	SCREAMING_SNAKE_CASE   (      self			:   int   )							->     Any:






     """simple docstring"""







     pass







  @unittest.skip("""ESMFold doesn't support data parallel."""   )
  def 	SCREAMING_SNAKE_CASE   (      self			:   Union[str, Any]   )							->     int:






     """simple docstring"""







     pass







  @unittest.skip("""Will be fixed soon by reducing the size of the model used for common tests."""   )
  def 	SCREAMING_SNAKE_CASE   (      self			:   List[Any]   )							->     List[Any]:






     """simple docstring"""







     pass






@require_torch
class SCREAMING_SNAKE_CASE     (  a_			):
  """simple docstring"""






  @slow
  def 	SCREAMING_SNAKE_CASE   (      self			:   Any   )							->     List[str]:






     """simple docstring"""







     __lowerCAmelCase  :      Dict    =						EsmForProteinFolding.from_pretrained("""facebook/esmfold_v1"""   ).float()
     model.eval()
     __lowerCAmelCase  :      Union[str, Any]    =						torch.tensor([[0, 6, 4, 13, 5, 4, 16, 12, 11, 7, 2]]   )
     __lowerCAmelCase  :      str    =						model(lowerCAmelCase   )["""positions"""]
     __lowerCAmelCase  :      str    =						torch.tensor([2.5828, 0.7993, -10.9334]	,							dtype=torch.floataa   )
     self.assertTrue(torch.allclose(position_outputs[0, 0, 0, 0]	,							lowerCAmelCase	,							atol=1e-4   )   )


