





import inspect
import unittest

from transformers import YolosConfig
from transformers.testing_utils import require_torch, require_vision, slow, torch_device
from transformers.utils import cached_property, is_torch_available, is_vision_available

from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, floats_tensor
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
     import torch
     from torch import nn

     from transformers import YolosForObjectDetection, YolosModel
     from transformers.models.yolos.modeling_yolos import YOLOS_PRETRAINED_MODEL_ARCHIVE_LIST


if is_vision_available():
     from PIL import Image

     from transformers import AutoImageProcessor

class      A       :



      def __init__(	self:						Optional[Any]		,  _lowerCAmelCase:						int		,  _lowerCAmelCase:						str=13		,  _lowerCAmelCase:						int=[30, 30]		,  _lowerCAmelCase:						Any=2		,  _lowerCAmelCase:						Any=3		,  _lowerCAmelCase:						Any=True		,  _lowerCAmelCase:						List[str]=True		,  _lowerCAmelCase:						Optional[Any]=32		,  _lowerCAmelCase:						Optional[int]=5		,  _lowerCAmelCase:						List[Any]=4		,  _lowerCAmelCase:						str=37		,  _lowerCAmelCase:						Optional[int]="gelu"		,  _lowerCAmelCase:						Dict=0.1		,  _lowerCAmelCase:						Any=0.1		,  _lowerCAmelCase:						Dict=10		,  _lowerCAmelCase:						Optional[Any]=0.02		,  _lowerCAmelCase:						Optional[int]=3		,  _lowerCAmelCase:						Union[str, Any]=None		,  _lowerCAmelCase:						Union[str, Any]=8		,  _lowerCAmelCase:						int=10		,  )						->    Union[str, Any]:
         '''simple docstring'''

         UpperCAmelCase_											=parent
         UpperCAmelCase_											=batch_size
         UpperCAmelCase_											=image_size
         UpperCAmelCase_											=patch_size
         UpperCAmelCase_											=num_channels
         UpperCAmelCase_											=is_training
         UpperCAmelCase_											=use_labels
         UpperCAmelCase_											=hidden_size
         UpperCAmelCase_											=num_hidden_layers
         UpperCAmelCase_											=num_attention_heads
         UpperCAmelCase_											=intermediate_size
         UpperCAmelCase_											=hidden_act
         UpperCAmelCase_											=hidden_dropout_prob
         UpperCAmelCase_											=attention_probs_dropout_prob
         UpperCAmelCase_											=type_sequence_label_size
         UpperCAmelCase_											=initializer_range
         UpperCAmelCase_											=num_labels
         UpperCAmelCase_											=scope
         UpperCAmelCase_											=n_targets
         UpperCAmelCase_											=num_detection_tokens
         # we set the expected sequence length (which is used in several tests)
         # expected sequence length = num_patches + 1 (we add 1 for the [CLS] token) + num_detection_tokens
         UpperCAmelCase_											=(image_size[1] // patch_size) * (image_size[0] // patch_size)
         UpperCAmelCase_											=num_patches + 1 + self.num_detection_tokens



      def 	lowerCAmelCase__    (	self:						str       )						->    List[Any]:
         '''simple docstring'''

         UpperCAmelCase_											=floats_tensor([self.batch_size, self.num_channels, self.image_size[0], self.image_size[1]]       )

         UpperCAmelCase_											=None
         if self.use_labels:
            # labels is a list of Dict (each Dict being the labels for a given example in the batch)
            UpperCAmelCase_											=[]
            for i in range(self.batch_size       ):
               UpperCAmelCase_											={}
               UpperCAmelCase_											=torch.randint(
                   high=self.num_labels		,  size=(self.n_targets,)		,  device=_lowerCAmelCase       )
               UpperCAmelCase_											=torch.rand(self.n_targets		,  4		,  device=_lowerCAmelCase       )
               labels.append(_lowerCAmelCase       )

         UpperCAmelCase_											=self.get_config()

         return config, pixel_values, labels



      def 	lowerCAmelCase__    (	self:						List[Any]       )						->    str:
         '''simple docstring'''

         return YolosConfig(
             image_size=self.image_size		,  patch_size=self.patch_size		,  num_channels=self.num_channels		,  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		,  hidden_dropout_prob=self.hidden_dropout_prob		,  attention_probs_dropout_prob=self.attention_probs_dropout_prob		,  is_decoder=_lowerCAmelCase		,  initializer_range=self.initializer_range		,  num_detection_tokens=self.num_detection_tokens		,  num_labels=self.num_labels		,  )



      def 	lowerCAmelCase__    (	self:						str		,  _lowerCAmelCase:						Optional[Any]		,  _lowerCAmelCase:						Optional[int]		,  _lowerCAmelCase:						Union[str, Any]       )						->    Any:
         '''simple docstring'''

         UpperCAmelCase_											=YolosModel(config=_lowerCAmelCase       )
         model.to(_lowerCAmelCase       )
         model.eval()
         UpperCAmelCase_											=model(_lowerCAmelCase       )
         self.parent.assertEqual(
             result.last_hidden_state.shape		,  (self.batch_size, self.expected_seq_len, self.hidden_size)       )



      def 	lowerCAmelCase__    (	self:						Optional[Any]		,  _lowerCAmelCase:						int		,  _lowerCAmelCase:						str		,  _lowerCAmelCase:						Optional[Any]       )						->    Any:
         '''simple docstring'''

         UpperCAmelCase_											=YolosForObjectDetection(_lowerCAmelCase       )
         model.to(_lowerCAmelCase       )
         model.eval()

         UpperCAmelCase_											=model(pixel_values=_lowerCAmelCase       )
         UpperCAmelCase_											=model(_lowerCAmelCase       )

         self.parent.assertEqual(result.logits.shape		,  (self.batch_size, self.num_detection_tokens, self.num_labels + 1)       )
         self.parent.assertEqual(result.pred_boxes.shape		,  (self.batch_size, self.num_detection_tokens, 4)       )

         UpperCAmelCase_											=model(pixel_values=_lowerCAmelCase		,  labels=_lowerCAmelCase       )

         self.parent.assertEqual(result.loss.shape		,  ()       )
         self.parent.assertEqual(result.logits.shape		,  (self.batch_size, self.num_detection_tokens, self.num_labels + 1)       )
         self.parent.assertEqual(result.pred_boxes.shape		,  (self.batch_size, self.num_detection_tokens, 4)       )






      def 	lowerCAmelCase__    (	self:						int       )						->    str:
         '''simple docstring'''

         UpperCAmelCase_											=self.prepare_config_and_inputs()
         UpperCAmelCase_						,       UpperCAmelCase_						,       UpperCAmelCase_											=config_and_inputs
         UpperCAmelCase_											={"pixel_values": pixel_values}
         return config, inputs_dict

@require_torch
class      A       (	__lowercase		,      __lowercase		,      unittest.TestCase						):
      _snake_case							     =(YolosModel, YolosForObjectDetection) if is_torch_available() else ()
      _snake_case							     =(
          {'''feature-extraction''': YolosModel, '''object-detection''': YolosForObjectDetection} if is_torch_available() else {}
      )

      _snake_case							     =False
      _snake_case							     =False
      _snake_case							     =False
      _snake_case							     =False



      def 	lowerCAmelCase__    (	self:						Union[str, Any]		,  _lowerCAmelCase:						List[Any]		,  _lowerCAmelCase:						Dict		,  _lowerCAmelCase:						int=False       )						->    str:
         '''simple docstring'''

         UpperCAmelCase_											=super()._prepare_for_class(_lowerCAmelCase		,  _lowerCAmelCase		,  return_labels=_lowerCAmelCase       )

         if return_labels:
            if model_class.__name__ == "YolosForObjectDetection":
               UpperCAmelCase_											=[]
               for i in range(self.model_tester.batch_size       ):
                  UpperCAmelCase_											={}
                  UpperCAmelCase_											=torch.ones(
                      size=(self.model_tester.n_targets,)		,  device=_lowerCAmelCase		,  dtype=torch.long       )
                  UpperCAmelCase_											=torch.ones(
                      self.model_tester.n_targets		,  4		,  device=_lowerCAmelCase		,  dtype=torch.float       )
                  labels.append(_lowerCAmelCase       )
               UpperCAmelCase_											=labels

         return inputs_dict



      def 	lowerCAmelCase__    (	self:						List[Any]       )						->    Optional[int]:
         '''simple docstring'''

         UpperCAmelCase_											=YolosModelTester(self       )
         UpperCAmelCase_											=ConfigTester(self		,  config_class=_lowerCAmelCase		,  has_text_modality=_lowerCAmelCase		,  hidden_size=37       )



      def 	lowerCAmelCase__    (	self:						Any       )						->    str:
         '''simple docstring'''

         self.config_tester.run_common_tests()



      def 	lowerCAmelCase__    (	self:						Dict       )						->    List[str]:
         '''simple docstring'''

         pass



      def 	lowerCAmelCase__    (	self:						int       )						->    Optional[Any]:
         '''simple docstring'''

         UpperCAmelCase_						,       UpperCAmelCase_											=self.model_tester.prepare_config_and_inputs_for_common()

         for model_class in self.all_model_classes:
            UpperCAmelCase_											=model_class(_lowerCAmelCase       )
            self.assertIsInstance(model.get_input_embeddings()		,  (nn.Module)       )
            UpperCAmelCase_											=model.get_output_embeddings()
            self.assertTrue(x is None or isinstance(_lowerCAmelCase		,  nn.Linear       )       )



      def 	lowerCAmelCase__    (	self:						Dict       )						->    Any:
         '''simple docstring'''

         UpperCAmelCase_						,       UpperCAmelCase_											=self.model_tester.prepare_config_and_inputs_for_common()

         for model_class in self.all_model_classes:
            UpperCAmelCase_											=model_class(_lowerCAmelCase       )
            UpperCAmelCase_											=inspect.signature(model.forward       )
            # signature.parameters is an OrderedDict => so arg_names order is deterministic
            UpperCAmelCase_											=[*signature.parameters.keys()]

            UpperCAmelCase_											=["pixel_values"]
            self.assertListEqual(arg_names[:1]		,  _lowerCAmelCase       )



      def 	lowerCAmelCase__    (	self:						Union[str, Any]       )						->    Dict:
         '''simple docstring'''

         UpperCAmelCase_											=self.model_tester.prepare_config_and_inputs()
         self.model_tester.create_and_check_model(*_lowerCAmelCase       )



      def 	lowerCAmelCase__    (	self:						str       )						->    Optional[int]:
         '''simple docstring'''

         UpperCAmelCase_						,       UpperCAmelCase_											=self.model_tester.prepare_config_and_inputs_for_common()
         UpperCAmelCase_											=True

         # in YOLOS, the seq_len is different
         UpperCAmelCase_											=self.model_tester.expected_seq_len
         for model_class in self.all_model_classes:
            UpperCAmelCase_											=True
            UpperCAmelCase_											=False
            UpperCAmelCase_											=True
            UpperCAmelCase_											=model_class(_lowerCAmelCase       )
            model.to(_lowerCAmelCase       )
            model.eval()
            with torch.no_grad():
               UpperCAmelCase_											=model(**self._prepare_for_class(_lowerCAmelCase		,  _lowerCAmelCase       )       )
            UpperCAmelCase_											=outputs.attentions
            self.assertEqual(len(_lowerCAmelCase       )		,  self.model_tester.num_hidden_layers       )

            # check that output_attentions also work using config
            del inputs_dict["output_attentions"]
            UpperCAmelCase_											=True
            UpperCAmelCase_											=model_class(_lowerCAmelCase       )
            model.to(_lowerCAmelCase       )
            model.eval()
            with torch.no_grad():
               UpperCAmelCase_											=model(**self._prepare_for_class(_lowerCAmelCase		,  _lowerCAmelCase       )       )
            UpperCAmelCase_											=outputs.attentions
            self.assertEqual(len(_lowerCAmelCase       )		,  self.model_tester.num_hidden_layers       )

            self.assertListEqual(
                list(attentions[0].shape[-3:]       )		,  [self.model_tester.num_attention_heads, seq_len, seq_len]		,  )
            UpperCAmelCase_											=len(_lowerCAmelCase       )

            # Check attention is always last and order is fine
            UpperCAmelCase_											=True
            UpperCAmelCase_											=True
            UpperCAmelCase_											=model_class(_lowerCAmelCase       )
            model.to(_lowerCAmelCase       )
            model.eval()
            with torch.no_grad():
               UpperCAmelCase_											=model(**self._prepare_for_class(_lowerCAmelCase		,  _lowerCAmelCase       )       )

            UpperCAmelCase_											=1
            self.assertEqual(out_len + added_hidden_states		,  len(_lowerCAmelCase       )       )

            UpperCAmelCase_											=outputs.attentions

            self.assertEqual(len(_lowerCAmelCase       )		,  self.model_tester.num_hidden_layers       )
            self.assertListEqual(
                list(self_attentions[0].shape[-3:]       )		,  [self.model_tester.num_attention_heads, seq_len, seq_len]		,  )



      def 	lowerCAmelCase__    (	self:						int       )						->    Any:
         '''simple docstring'''

         def check_hidden_states_output(_lowerCAmelCase:						Any		,  _lowerCAmelCase:						Union[str, Any]		,  _lowerCAmelCase:						Any       ):
            UpperCAmelCase_											=model_class(_lowerCAmelCase       )
            model.to(_lowerCAmelCase       )
            model.eval()

            with torch.no_grad():
               UpperCAmelCase_											=model(**self._prepare_for_class(_lowerCAmelCase		,  _lowerCAmelCase       )       )

            UpperCAmelCase_											=outputs.hidden_states

            UpperCAmelCase_											=getattr(
                self.model_tester		,  "expected_num_hidden_layers"		,  self.model_tester.num_hidden_layers + 1       )
            self.assertEqual(len(_lowerCAmelCase       )		,  _lowerCAmelCase       )

            # YOLOS has a different seq_length
            UpperCAmelCase_											=self.model_tester.expected_seq_len

            self.assertListEqual(
                list(hidden_states[0].shape[-2:]       )		,  [seq_length, self.model_tester.hidden_size]		,  )

         UpperCAmelCase_						,       UpperCAmelCase_											=self.model_tester.prepare_config_and_inputs_for_common()

         for model_class in self.all_model_classes:
            UpperCAmelCase_											=True
            check_hidden_states_output(_lowerCAmelCase		,  _lowerCAmelCase		,  _lowerCAmelCase       )

            # check that output_hidden_states also work using config
            del inputs_dict["output_hidden_states"]
            UpperCAmelCase_											=True

            check_hidden_states_output(_lowerCAmelCase		,  _lowerCAmelCase		,  _lowerCAmelCase       )



      def 	lowerCAmelCase__    (	self:						List[Any]       )						->    Optional[Any]:
         '''simple docstring'''

         UpperCAmelCase_											=self.model_tester.prepare_config_and_inputs()
         self.model_tester.create_and_check_for_object_detection(*_lowerCAmelCase       )






      @slow
      def 	lowerCAmelCase__    (	self:						Optional[int]       )						->    Optional[int]:
         '''simple docstring'''

         for model_name in YOLOS_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
            UpperCAmelCase_											=YolosModel.from_pretrained(_lowerCAmelCase       )
            self.assertIsNotNone(_lowerCAmelCase       )




def     a__ (					):






   '''simple docstring'''






   UpperCAmelCase_											=Image.open("./tests/fixtures/tests_samples/COCO/000000039769.png"  )
   return image





@require_torch
@require_vision
class      A       (	unittest.TestCase						):



      @cached_property
      def 	lowerCAmelCase__    (	self:						List[str]       )						->    Optional[Any]:
         '''simple docstring'''

         return AutoImageProcessor.from_pretrained("hustvl/yolos-small"       ) if is_vision_available() else None






      @slow
      def 	lowerCAmelCase__    (	self:						Optional[int]       )						->    Dict:
         '''simple docstring'''

         UpperCAmelCase_											=YolosForObjectDetection.from_pretrained("hustvl/yolos-small"       ).to(_lowerCAmelCase       )

         UpperCAmelCase_											=self.default_image_processor
         UpperCAmelCase_											=prepare_img()
         UpperCAmelCase_											=image_processor(images=_lowerCAmelCase		,  return_tensors="pt"       ).to(_lowerCAmelCase       )

         # forward pass
         with torch.no_grad():
            UpperCAmelCase_											=model(inputs.pixel_values       )

         # verify outputs
         UpperCAmelCase_											=torch.Size((1, 100, 92)       )
         self.assertEqual(outputs.logits.shape		,  _lowerCAmelCase       )

         UpperCAmelCase_											=torch.tensor(
             [[-24.02_48, -10.30_24, -14.82_90], [-42.03_92, -16.82_00, -27.43_34], [-27.27_43, -11.81_54, -18.71_48]]		,  device=_lowerCAmelCase		,  )
         UpperCAmelCase_											=torch.tensor(
             [[0.25_59, 0.54_55, 0.47_06], [0.29_89, 0.72_79, 0.18_75], [0.77_32, 0.40_17, 0.44_62]]		,  device=_lowerCAmelCase       )
         self.assertTrue(torch.allclose(outputs.logits[0, :3, :3]		,  _lowerCAmelCase		,  atol=1e-4       )       )
         self.assertTrue(torch.allclose(outputs.pred_boxes[0, :3, :3]		,  _lowerCAmelCase		,  atol=1e-4       )       )

         # verify postprocessing
         UpperCAmelCase_											=image_processor.post_process_object_detection(
             _lowerCAmelCase		,  threshold=0.3		,  target_sizes=[image.size[::-1]]       )[0]
         UpperCAmelCase_											=torch.tensor([0.99_94, 0.97_90, 0.99_64, 0.99_72, 0.98_61]       ).to(_lowerCAmelCase       )
         UpperCAmelCase_											=[75, 75, 17, 63, 17]
         UpperCAmelCase_											=torch.tensor([3_35.06_09, 79.38_48, 3_75.42_16, 1_87.24_95]       ).to(_lowerCAmelCase       )

         self.assertEqual(len(results["scores"]       )		,  5       )
         self.assertTrue(torch.allclose(results["scores"]		,  _lowerCAmelCase		,  atol=1e-4       )       )
         self.assertSequenceEqual(results["labels"].tolist()		,  _lowerCAmelCase       )
         self.assertTrue(torch.allclose(results["boxes"][0, :]		,  _lowerCAmelCase       )       )











# Usage:
# ./gen-card-facebook-wmt19.py

import os
from pathlib import Path




def     a__ (					lowercase__  ,    lowercase__  ,    lowercase__  ):






   '''simple docstring'''






   UpperCAmelCase_											={
       "en": "Machine learning is great, isn't it?",
       "ru": "Машинное обучение - это здорово, не так ли?",
       "de": "Maschinelles Lernen ist großartig, oder?",
   }

   # BLUE scores as follows:
   # "pair": [fairseq, transformers]
   UpperCAmelCase_											={
       "ru-en": ["[41.3](http://matrix.statmt.org/matrix/output/1907?run_id=6937)", "39.20"],
       "en-ru": ["[36.4](http://matrix.statmt.org/matrix/output/1914?run_id=6724)", "33.47"],
       "en-de": ["[43.1](http://matrix.statmt.org/matrix/output/1909?run_id=6862)", "42.83"],
       "de-en": ["[42.3](http://matrix.statmt.org/matrix/output/1902?run_id=6750)", "41.35"],
   }
   UpperCAmelCase_											=F'{src_lang}-{tgt_lang}'

   UpperCAmelCase_											=F'\n---\nlanguage: \n- {src_lang}\n- {tgt_lang}\nthumbnail:\ntags:\n- translation\n- wmt19\n- facebook\nlicense: apache-2.0\ndatasets:\n- wmt19\nmetrics:\n- bleu\n---\n\n# FSMT\n\n## Model description\n\nThis is a ported version of [fairseq wmt19 transformer](https://github.com/pytorch/fairseq/blob/master/examples/wmt19/README.md) for {src_lang}-{tgt_lang}.\n\nFor more details, please see, [Facebook FAIR\'s WMT19 News Translation Task Submission](https://arxiv.org/abs/1907.06616).\n\nThe abbreviation FSMT stands for FairSeqMachineTranslation\n\nAll four models are available:\n\n* [wmt19-en-ru](https://huggingface.co/facebook/wmt19-en-ru)\n* [wmt19-ru-en](https://huggingface.co/facebook/wmt19-ru-en)\n* [wmt19-en-de](https://huggingface.co/facebook/wmt19-en-de)\n* [wmt19-de-en](https://huggingface.co/facebook/wmt19-de-en)\n\n## Intended uses & limitations\n\n#### How to use\n\n```python\nfrom transformers import FSMTForConditionalGeneration, FSMTTokenizer\nmname = "facebook/wmt19-{src_lang}-{tgt_lang}"\ntokenizer = FSMTTokenizer.from_pretrained(mname)\nmodel = FSMTForConditionalGeneration.from_pretrained(mname)\n\ninput = "{texts[src_lang]}"\ninput_ids = tokenizer.encode(input, return_tensors="pt")\noutputs = model.generate(input_ids)\ndecoded = tokenizer.decode(outputs[0], skip_special_tokens=True)\nprint(decoded) # {texts[tgt_lang]}\n\n```\n\n#### Limitations and bias\n\n- The original (and this ported model) doesn\'t seem to handle well inputs with repeated sub-phrases, [content gets truncated](https://discuss.huggingface.co/t/issues-with-translating-inputs-containing-repeated-phrases/981)\n\n## Training data\n\nPretrained weights were left identical to the original model released by fairseq. For more details, please, see the [paper](https://arxiv.org/abs/1907.06616).\n\n## Eval results\n\npair   | fairseq | transformers\n-------|---------|----------\n{pair}  | {scores[pair][0]} | {scores[pair][1]}\n\nThe score is slightly below the score reported by `fairseq`, since `transformers`` currently doesn\'t support:\n- model ensemble, therefore the best performing checkpoint was ported (``model4.pt``).\n- re-ranking\n\nThe score was calculated using this code:\n\n```bash\ngit clone https://github.com/huggingface/transformers\ncd transformers\nexport PAIR={pair}\nexport DATA_DIR=data/$PAIR\nexport SAVE_DIR=data/$PAIR\nexport BS=8\nexport NUM_BEAMS=15\nmkdir -p $DATA_DIR\nsacrebleu -t wmt19 -l $PAIR --echo src > $DATA_DIR/val.source\nsacrebleu -t wmt19 -l $PAIR --echo ref > $DATA_DIR/val.target\necho $PAIR\nPYTHONPATH="src:examples/seq2seq" python examples/seq2seq/run_eval.py facebook/wmt19-$PAIR $DATA_DIR/val.source $SAVE_DIR/test_translations.txt --reference_path $DATA_DIR/val.target --score_path $SAVE_DIR/test_bleu.json --bs $BS --task translation --num_beams $NUM_BEAMS\n```\nnote: fairseq reports using a beam of 50, so you should get a slightly higher score if re-run with `--num_beams 50`.\n\n## Data Sources\n\n- [training, etc.](http://www.statmt.org/wmt19/)\n- [test set](http://matrix.statmt.org/test_sets/newstest2019.tgz?1556572561)\n\n\n### BibTeX entry and citation info\n\n```bibtex\n@inproceedings{{...,\n  year={{2020}},\n  title={{Facebook FAIR\'s WMT19 News Translation Task Submission}},\n  author={{Ng, Nathan and Yee, Kyra and Baevski, Alexei and Ott, Myle and Auli, Michael and Edunov, Sergey}},\n  booktitle={{Proc. of WMT}},\n}}\n```\n\n\n## TODO\n\n- port model ensemble (fairseq uses 4 model checkpoints)\n\n'
   os.makedirs(lowercase__  ,    exist_ok=lowercase__  )
   UpperCAmelCase_											=os.path.join(lowercase__  ,    "README.md"  )
   print(F'Generating {path}'  )
   with open(lowercase__  ,    "w"  ,    encoding="utf-8"  ) as f:
      f.write(lowercase__  )


# make sure we are under the root of the project
__lowercase  :   int						      =Path(__file__).resolve().parent.parent.parent
__lowercase  :   Any						      =repo_dir / """model_cards"""

for model_name in ["wmt19-ru-en", "wmt19-en-ru", "wmt19-en-de", "wmt19-de-en"]:
     __lowercase      ,			__lowercase      ,			__lowercase  :   Union[str, Any]						      =model_name.split("""-""")
     __lowercase  :   Optional[int]						      =model_cards_dir / """facebook""" / model_name
     write_model_card(model_card_dir, src_lang=src_lang, tgt_lang=tgt_lang)




