


import collections
import json
import math
import os
import re
import time
from fnmatch import fnmatch
from typing import Dict

import requests
from slack_sdk import WebClient


__lowerCAmelCase			=							WebClient(token=os.environ['''CI_SLACK_BOT_TOKEN'''])




def        snake_case_					(  snake_case					)  ->    int:
       lowercase__:       Any        =       test_results.split(' '					)

       lowercase__:       List[Any]        =       0
       lowercase__:       Optional[int]        =       0

       # When the output is short enough, the output is surrounded by = signs: "== OUTPUT =="
       # When it is too long, those signs are not present.
       lowercase__:       Optional[int]        =       expressions[-2] if '=' in expressions[-1] else expressions[-1]

       for i, expression in enumerate(snake_case					):
              if "failed" in expression:
                     failed += int(expressions[i - 1]					)
              if "passed" in expression:
                     success += int(expressions[i - 1]					)

       return failed, success, time_spent




def        snake_case_					(  snake_case					)  ->    Union[str, Any]:
       lowercase__:       List[Any]        =       {}
       lowercase__:       int        =       None
       lowercase__:       Optional[Any]        =       False
       for line in failures_short_lines.split('\n'					):
              if re.search(R'_ \[doctest\]'      ,							snake_case					):
                     lowercase__:       Tuple        =       True
                     lowercase__:       Any        =       line.split(' '					)[2]
              elif in_error and not line.split(' '					)[0].isdigit():
                     lowercase__:       str        =       line
                     lowercase__:       str        =       False

       return failures





class   __a      :
     def __init__(       self    ,			lowerCAmelCase__    ,			lowerCAmelCase__			) ->    List[str]:




            '''simple docstring'''
            lowercase__:       Any        =       title

            lowercase__:       Tuple        =       doc_test_results['time_spent'].split(','			)[0]
            lowercase__:       Optional[int]        =       doc_test_results['success']
            lowercase__:       List[Any]        =       doc_test_results['failures']
            lowercase__:       str        =       self.n_success + self.n_failures

            # Failures and success of the modeling tests
            lowercase__:       Optional[Any]        =       doc_test_results
     @property
     def 		SCREAMING_SNAKE_CASE__       (       self			) ->    Optional[Any]:




            '''simple docstring'''
            lowercase__:       Optional[Any]        =       [self._time_spent]
            lowercase__:       Union[str, Any]        =       0

            for time in time_spent:
                   lowercase__:       Union[str, Any]        =       time.split(':'			)

                   # Time can be formatted as xx:xx:xx, as .xx, or as x.xx if the time spent was less than a minute.
                   if len(__SCREAMING_SNAKE_CASE			) == 1:
                          lowercase__:       Tuple        =       [0, 0, time_parts[0]]

                   lowercase__      ,						lowercase__      ,						lowercase__:       Any        =       int(time_parts[0]			), int(time_parts[1]			), float(time_parts[2]			)
                   total_secs += hours * 3_600 + minutes * 60 + seconds

            lowercase__      ,						lowercase__      ,						lowercase__:       Tuple        =       total_secs // 3_600, (total_secs % 3_600) // 60, total_secs % 60
            return F'{int(__SCREAMING_SNAKE_CASE			)}h{int(__SCREAMING_SNAKE_CASE			)}m{int(__SCREAMING_SNAKE_CASE			)}s'
     @property
     def 		SCREAMING_SNAKE_CASE__       (       self			) ->    Tuple:




            '''simple docstring'''
            return {"type": "header", "text": {"type": "plain_text", "text": self.title}}
     @property
     def 		SCREAMING_SNAKE_CASE__       (       self			) ->    Union[str, Any]:




            '''simple docstring'''
            return {
                "type": "section",
                "text": {
                    "type": "plain_text",
                    "text": F'🌞 There were no failures: all {self.n_tests} tests passed. The suite ran in {self.time}.',
                    "emoji": True,
                },
                "accessory": {
                    "type": "button",
                    "text": {"type": "plain_text", "text": "Check Action results", "emoji": True},
                    "url": F'https://github.com/huggingface/transformers/actions/runs/{os.environ["GITHUB_RUN_ID"]}',
                },
            }
     @property
     def 		SCREAMING_SNAKE_CASE__       (       self			) ->    Optional[Any]:




            '''simple docstring'''
            return {
                "type": "section",
                "text": {
                    "type": "plain_text",
                    "text": (
                        F'There were {self.n_failures} failures, out of {self.n_tests} tests.\nThe suite ran in'
                        F' {self.time}.'
                    ),
                    "emoji": True,
                },
                "accessory": {
                    "type": "button",
                    "text": {"type": "plain_text", "text": "Check Action results", "emoji": True},
                    "url": F'https://github.com/huggingface/transformers/actions/runs/{os.environ["GITHUB_RUN_ID"]}',
                },
            }
     @property
     def 		SCREAMING_SNAKE_CASE__       (       self			) ->    str:




            '''simple docstring'''
            lowercase__:       Union[str, Any]        =       40
            lowercase__:       Optional[Any]        =       {k: v['failed'] for k, v in doc_test_results.items() if isinstance(__SCREAMING_SNAKE_CASE    ,			__SCREAMING_SNAKE_CASE			)}

            lowercase__:       Optional[int]        =       ''
            for category, failures in category_failures.items():
                   if len(__SCREAMING_SNAKE_CASE			) == 0:
                          continue

                   if report != "":
                          report += "\n\n"

                   report += F'*{category} failures*:'.ljust(line_length // 2			).rjust(line_length // 2			) + "\n"
                   report += "`"
                   report += "`\n`".join(__SCREAMING_SNAKE_CASE			)
                   report += "`"

            return {
                "type": "section",
                "text": {
                    "type": "mrkdwn",
                    "text": F'The following examples had failures:\n\n\n{report}\n',
                },
            }
     @property
     def 		SCREAMING_SNAKE_CASE__       (       self			) ->    List[str]:




            '''simple docstring'''
            lowercase__:       int        =       [self.header]

            if self.n_failures > 0:
                   blocks.append(self.failures			)

            if self.n_failures > 0:
                   blocks.extend([self.category_failures]			)

            if self.n_failures == 0:
                   blocks.append(self.no_failures			)

            return json.dumps(__SCREAMING_SNAKE_CASE			)
     @staticmethod
     def 		SCREAMING_SNAKE_CASE__       (       ) ->    Optional[int]:




            '''simple docstring'''
            lowercase__:       Tuple        =       [
                {
                    'type': 'section',
                    'text': {
                        'type': 'plain_text',
                        'text': 'There was an issue running the tests.',
                    },
                    'accessory': {
                        'type': 'button',
                        'text': {'type': 'plain_text', 'text': 'Check Action results', 'emoji': True},
                        'url': F'https://github.com/huggingface/transformers/actions/runs/{os.environ["GITHUB_RUN_ID"]}',
                    },
                }
            ]

            print('Sending the following payload'			)
            print(json.dumps({'blocks': json.loads(__SCREAMING_SNAKE_CASE			)}			)			)

            client.chat_postMessage(
                channel=os.environ['CI_SLACK_CHANNEL_ID_DAILY']    ,			text='There was an issue running the tests.'    ,			blocks=__SCREAMING_SNAKE_CASE    ,			)
     def 		SCREAMING_SNAKE_CASE__       (       self			) ->    int:




            '''simple docstring'''
            print('Sending the following payload'			)
            print(json.dumps({'blocks': json.loads(self.payload			)}			)			)

            lowercase__:       List[Any]        =       F'{self.n_failures} failures out of {self.n_tests} tests,' if self.n_failures else 'All tests passed.'

            lowercase__:       Optional[int]        =       client.chat_postMessage(
                channel=os.environ['CI_SLACK_CHANNEL_ID_DAILY']    ,			blocks=self.payload    ,			text=__SCREAMING_SNAKE_CASE    ,			)
     def 		SCREAMING_SNAKE_CASE__       (       self    ,			lowerCAmelCase__    ,			lowerCAmelCase__    ,			lowerCAmelCase__    ,			lowerCAmelCase__			) ->    Dict:




            '''simple docstring'''
            lowercase__:       List[str]        =       ''
            for key, value in failures.items():
                   lowercase__:       Union[str, Any]        =       value[:200] + ' [Truncated]' if len(__SCREAMING_SNAKE_CASE			) > 250 else value
                   failures_text += F'*{key}*\n_{value}_\n\n'

            lowercase__:       int        =       job_name
            lowercase__:       Optional[int]        =       {'type': 'section', 'text': {'type': 'mrkdwn', 'text': text}}

            if job_link is not None:
                   lowercase__:       List[Any]        =       {
                       'type': 'button',
                       'text': {'type': 'plain_text', 'text': 'GitHub Action job', 'emoji': True},
                       'url': job_link,
                   }

            return [
                {"type": "header", "text": {"type": "plain_text", "text": title.upper(), "emoji": True}},
                content,
                {"type": "section", "text": {"type": "mrkdwn", "text": failures_text}},
            ]
     def 		SCREAMING_SNAKE_CASE__       (       self			) ->    Any:




            '''simple docstring'''

            if self.thread_ts is None:
                   raise ValueError('Can only post reply if a post has been made.'			)

            lowercase__:       List[str]        =       self.doc_test_results.pop('job_link'			)
            self.doc_test_results.pop('failures'			)
            self.doc_test_results.pop('success'			)
            self.doc_test_results.pop('time_spent'			)

            lowercase__:       List[Any]        =       sorted(self.doc_test_results.items()    ,			key=lambda lowerCAmelCase__			: t[0]			)
            for job, job_result in sorted_dict:
                   if len(job_result['failures']			):
                          lowercase__:       Any        =       F'*Num failures* :{len(job_result["failed"]			)} \n'
                          lowercase__:       Union[str, Any]        =       job_result['failures']
                          lowercase__:       Tuple        =       self.get_reply_blocks(__SCREAMING_SNAKE_CASE    ,			__SCREAMING_SNAKE_CASE    ,			__SCREAMING_SNAKE_CASE    ,			text=__SCREAMING_SNAKE_CASE			)

                          print('Sending the following reply'			)
                          print(json.dumps({'blocks': blocks}			)			)

                          client.chat_postMessage(
                              channel=os.environ['CI_SLACK_CHANNEL_ID_DAILY']    ,			text=F'Results for {job}'    ,			blocks=__SCREAMING_SNAKE_CASE    ,			thread_ts=self.thread_ts['ts']    ,			)

                          time.sleep(1			)





def        snake_case_					(  )  ->    Tuple:
       lowercase__:       Dict        =       os.environ['GITHUB_RUN_ID']
       lowercase__:       Optional[Any]        =       f'https://api.github.com/repos/huggingface/transformers/actions/runs/{run_id}/jobs?per_page=100'
       lowercase__:       Dict        =       requests.get(snake_case					).json()
       lowercase__:       Any        =       {}

       try:
              jobs.update({job['name']: job['html_url'] for job in result['jobs']}					)
              lowercase__:       List[Any]        =       math.ceil((result['total_count'] - 1_00) / 1_00					)

              for i in range(snake_case					):
                     lowercase__:       str        =       requests.get(url + f'&page={i + 2}'					).json()
                     jobs.update({job['name']: job['html_url'] for job in result['jobs']}					)

              return jobs
       except Exception as e:
              print('Unknown error, could not fetch links.'      ,							snake_case					)

       return {}




def        snake_case_					(  snake_case					)  ->    str:
       lowercase__:       int        =       {}

       if os.path.exists(snake_case					):
              lowercase__:       Optional[Any]        =       os.listdir(snake_case					)
              for file in files:
                     try:
                            with open(os.path.join(snake_case      ,							snake_case					)      ,							encoding='utf-8'					) as f:
                                   lowercase__:       Union[str, Any]        =       f.read()
                     except UnicodeDecodeError as e:
                            raise ValueError(f'Could not open {os.path.join(snake_case      ,							snake_case					)}.'					) from e

       return _artifact




def        snake_case_					(  )  ->    Optional[int]:





       class   __a      :
            def __init__(       self    ,			lowerCAmelCase__			) ->    str:




                   '''simple docstring'''
                   lowercase__:       Dict        =       name
                   lowercase__:       Optional[Any]        =       []
            def __str__(       self			) ->    Optional[Any]:




                   '''simple docstring'''
                   return self.name
            def 		SCREAMING_SNAKE_CASE__       (       self    ,			lowerCAmelCase__			) ->    Optional[int]:




                   '''simple docstring'''
                   self.paths.append({'name': self.name, 'path': path}			)





       lowercase__:       Tuple        =       {}

       lowercase__:       str        =       filter(os.path.isdir      ,							os.listdir()					)
       for directory in directories:
              lowercase__:       str        =       directory
              if artifact_name not in _available_artifacts:
                     lowercase__:       str        =       Artifact(snake_case					)

                     _available_artifacts[artifact_name].add_path(snake_case					)

       return _available_artifacts


if __name__ == "__main__":
 __lowerCAmelCase			=							get_job_links()
 __lowerCAmelCase			=							retrieve_available_artifacts()

 __lowerCAmelCase			=							collections.OrderedDict(
     [
         ('''*.py''', '''API Examples'''),
         ('''*.md''', '''MD Examples'''),
     ]
 )

 # This dict will contain all the information relative to each doc test category:
 # - failed: list of failed tests
 # - failures: dict in the format 'test': 'error_message'
 __lowerCAmelCase			=							{
     v: {
         """failed""": [],
         """failures""": {},
     }
     for v in docs.values()
 }

 # Link to the GitHub Action job
 __lowerCAmelCase			=							github_actions_job_links.get('''run_doctests''')

 __lowerCAmelCase			=							available_artifacts["""doc_tests_gpu_test_reports"""].paths[0]
 __lowerCAmelCase			=							retrieve_artifact(artifact_path['''name'''])
 if "stats" in artifact:
  __lowerCAmelCase			=							handle_test_results(artifact['''stats'''])
  __lowerCAmelCase			=							failed
  __lowerCAmelCase			=							success
  __lowerCAmelCase			=							time_spent[1:-1] + """, """

  __lowerCAmelCase			=							extract_first_line_failure(artifact['''failures_short'''])
  for line in artifact["summary_short"].split('''\n'''):
   if re.search('''FAILED''', line):
    __lowerCAmelCase			=							line.replace('''FAILED ''', '''''')
    __lowerCAmelCase			=							line.split()[0].replace('''\n''', '''''')

    if "::" in line:
     __lowerCAmelCase			=							line.split('''::''')
    else:
     __lowerCAmelCase			=							line, line

    for file_regex in docs.keys():
     if fnmatch(file_path, file_regex):
      __lowerCAmelCase			=							docs[file_regex]
      doc_test_results[category]["failed"].append(test)

      __lowerCAmelCase			=							all_failures[test] if test in all_failures else """N/A"""
      __lowerCAmelCase			=							failure
      break

 __lowerCAmelCase			=							Message('''🤗 Results of the doc tests.''', doc_test_results)
 message.post()
 message.post_reply()






import argparse
import os
import re

import tensorflow as tf
import torch

from transformers import BertConfig, BertModel
from transformers.utils import logging


logging.set_verbosity_info()
__lowerCAmelCase			=							logging.get_logger(__name__)




def        snake_case_					(  snake_case      ,							snake_case      ,							snake_case					)  ->    Any:
       lowercase__:       Dict        =       os.path.abspath(snake_case					)
       logger.info(f'Converting TensorFlow checkpoint from {tf_path}'					)
       # Load weights from TF model
       lowercase__:       Optional[Any]        =       tf.train.list_variables(snake_case					)
       lowercase__:       List[Any]        =       []
       lowercase__:       Tuple        =       []
       lowercase__:       int        =       []
       for full_name, shape in init_vars:
              # logger.info(f"Loading TF weight {name} with shape {shape}")
              lowercase__:       Union[str, Any]        =       full_name.split('/'					)
              if full_name == "_CHECKPOINTABLE_OBJECT_GRAPH" or name[0] in ["global_step", "save_counter"]:
                     logger.info(f'Skipping non-model layer {full_name}'					)
                     continue
              if "optimizer" in full_name:
                     logger.info(f'Skipping optimization layer {full_name}'					)
                     continue
              if name[0] == "model":
                     # ignore initial 'model'
                     lowercase__:       str        =       name[1:]
              # figure out how many levels deep the name is
              lowercase__:       Optional[Any]        =       0
              for _name in name:
                     if _name.startswith('layer_with_weights'					):
                            depth += 1
                     else:
                            break
              layer_depth.append(snake_case					)
              # read data
              lowercase__:       Optional[Any]        =       tf.train.load_variable(snake_case      ,							snake_case					)
              names.append('/'.join(snake_case					)					)
              arrays.append(snake_case					)
       logger.info(f'Read a total of {len(snake_case					):,} layers'					)

       # Sanity check
       if len(set(snake_case					)					) != 1:
              raise ValueError(f'Found layer names with different depths (layer depth {list(set(snake_case					)					)})'					)
       lowercase__:       Any        =       list(set(snake_case					)					)[0]
       if layer_depth != 1:
              raise ValueError(
                  'The model contains more than just the embedding/encoder layers. This script does not handle MLM/NSP'
                  ' heads.'					)

       # convert layers
       logger.info('Converting weights...'					)
       for full_name, array in zip(snake_case      ,							snake_case					):
              lowercase__:       Optional[int]        =       full_name.split('/'					)
              lowercase__:       List[Any]        =       model
              lowercase__:       Any        =       []
              for i, m_name in enumerate(snake_case					):
                     if m_name == ".ATTRIBUTES":
                            # variable names end with .ATTRIBUTES/VARIABLE_VALUE
                            break
                     if m_name.startswith('layer_with_weights'					):
                            lowercase__:       Any        =       int(m_name.split('-'					)[-1]					)
                            if layer_num <= 2:
                                   # embedding layers
                                   # layer_num 0: word_embeddings
                                   # layer_num 1: position_embeddings
                                   # layer_num 2: token_type_embeddings
                                   continue
                            elif layer_num == 3:
                                   # embedding LayerNorm
                                   trace.extend(['embeddings', 'LayerNorm']					)
                                   lowercase__:       str        =       getattr(snake_case      ,							'embeddings'					)
                                   lowercase__:       int        =       getattr(snake_case      ,							'LayerNorm'					)
                            elif layer_num > 3 and layer_num < config.num_hidden_layers + 4:
                                   # encoder layers
                                   trace.extend(['encoder', 'layer', str(layer_num - 4					)]					)
                                   lowercase__:       int        =       getattr(snake_case      ,							'encoder'					)
                                   lowercase__:       List[str]        =       getattr(snake_case      ,							'layer'					)
                                   lowercase__:       Union[str, Any]        =       pointer[layer_num - 4]
                            elif layer_num == config.num_hidden_layers + 4:
                                   # pooler layer
                                   trace.extend(['pooler', 'dense']					)
                                   lowercase__:       Tuple        =       getattr(snake_case      ,							'pooler'					)
                                   lowercase__:       Tuple        =       getattr(snake_case      ,							'dense'					)
                     elif m_name == "embeddings":
                            trace.append('embeddings'					)
                            lowercase__:       Union[str, Any]        =       getattr(snake_case      ,							'embeddings'					)
                            if layer_num == 0:
                                   trace.append('word_embeddings'					)
                                   lowercase__:       Union[str, Any]        =       getattr(snake_case      ,							'word_embeddings'					)
                            elif layer_num == 1:
                                   trace.append('position_embeddings'					)
                                   lowercase__:       Dict        =       getattr(snake_case      ,							'position_embeddings'					)
                            elif layer_num == 2:
                                   trace.append('token_type_embeddings'					)
                                   lowercase__:       Optional[Any]        =       getattr(snake_case      ,							'token_type_embeddings'					)
                            else:
                                   raise ValueError(f'Unknown embedding layer with name {full_name}'					)
                            trace.append('weight'					)
                            lowercase__:       List[str]        =       getattr(snake_case      ,							'weight'					)
                     elif m_name == "_attention_layer":
                            # self-attention layer
                            trace.extend(['attention', 'self']					)
                            lowercase__:       int        =       getattr(snake_case      ,							'attention'					)
                            lowercase__:       Union[str, Any]        =       getattr(snake_case      ,							'self'					)
                     elif m_name == "_attention_layer_norm":
                            # output attention norm
                            trace.extend(['attention', 'output', 'LayerNorm']					)
                            lowercase__:       str        =       getattr(snake_case      ,							'attention'					)
                            lowercase__:       Optional[Any]        =       getattr(snake_case      ,							'output'					)
                            lowercase__:       List[Any]        =       getattr(snake_case      ,							'LayerNorm'					)
                     elif m_name == "_attention_output_dense":
                            # output attention dense
                            trace.extend(['attention', 'output', 'dense']					)
                            lowercase__:       Optional[Any]        =       getattr(snake_case      ,							'attention'					)
                            lowercase__:       Optional[int]        =       getattr(snake_case      ,							'output'					)
                            lowercase__:       Optional[Any]        =       getattr(snake_case      ,							'dense'					)
                     elif m_name == "_output_dense":
                            # output dense
                            trace.extend(['output', 'dense']					)
                            lowercase__:       Union[str, Any]        =       getattr(snake_case      ,							'output'					)
                            lowercase__:       List[Any]        =       getattr(snake_case      ,							'dense'					)
                     elif m_name == "_output_layer_norm":
                            # output dense
                            trace.extend(['output', 'LayerNorm']					)
                            lowercase__:       Any        =       getattr(snake_case      ,							'output'					)
                            lowercase__:       str        =       getattr(snake_case      ,							'LayerNorm'					)
                     elif m_name == "_key_dense":
                            # attention key
                            trace.append('key'					)
                            lowercase__:       Tuple        =       getattr(snake_case      ,							'key'					)
                     elif m_name == "_query_dense":
                            # attention query
                            trace.append('query'					)
                            lowercase__:       List[str]        =       getattr(snake_case      ,							'query'					)
                     elif m_name == "_value_dense":
                            # attention value
                            trace.append('value'					)
                            lowercase__:       Optional[int]        =       getattr(snake_case      ,							'value'					)
                     elif m_name == "_intermediate_dense":
                            # attention intermediate dense
                            trace.extend(['intermediate', 'dense']					)
                            lowercase__:       Any        =       getattr(snake_case      ,							'intermediate'					)
                            lowercase__:       str        =       getattr(snake_case      ,							'dense'					)
                     elif m_name == "_output_layer_norm":
                            # output layer norm
                            trace.append('output'					)
                            lowercase__:       Union[str, Any]        =       getattr(snake_case      ,							'output'					)
                     # weights & biases
                     elif m_name in ["bias", "beta"]:
                            trace.append('bias'					)
                            lowercase__:       str        =       getattr(snake_case      ,							'bias'					)
                     elif m_name in ["kernel", "gamma"]:
                            trace.append('weight'					)
                            lowercase__:       Tuple        =       getattr(snake_case      ,							'weight'					)
                     else:
                            logger.warning(f'Ignored {m_name}'					)
        # for certain layers reshape is necessary
              lowercase__:       Any        =       '.'.join(snake_case					)
              if re.match(R'(\S+)\.attention\.self\.(key|value|query)\.(bias|weight)'      ,							snake_case					) or re.match(
                  R'(\S+)\.attention\.output\.dense\.weight'      ,							snake_case					):
                     lowercase__:       Union[str, Any]        =       array.reshape(pointer.data.shape					)
              if "kernel" in full_name:
                     lowercase__:       str        =       array.transpose()
              if pointer.shape == array.shape:
                     lowercase__:       Union[str, Any]        =       torch.from_numpy(snake_case					)
              else:
                     raise ValueError(
                         f'Shape mismatch in layer {full_name}: Model expects shape {pointer.shape} but layer contains shape:'
                         f' {array.shape}'					)
              logger.info(f'Successfully set variable {full_name} to PyTorch layer {trace}'					)
       return model




def        snake_case_					(  snake_case      ,							snake_case      ,							snake_case					)  ->    Any:
       # Instantiate model
       logger.info(f'Loading model based on config from {config_path}...'					)
       lowercase__:       int        =       BertConfig.from_json_file(snake_case					)
       lowercase__:       Tuple        =       BertModel(snake_case					)

       # Load weights from checkpoint
       logger.info(f'Loading weights from checkpoint {tf_checkpoint_path}...'					)
       load_tfa_weights_in_bert(snake_case      ,							snake_case      ,							snake_case					)

       # Save pytorch-model
       logger.info(f'Saving PyTorch model to {pytorch_dump_path}...'					)
       torch.save(model.state_dict()      ,							snake_case					)


if __name__ == "__main__":
 __lowerCAmelCase			=							argparse.ArgumentParser()
 parser.add_argument(
     '''--tf_checkpoint_path''', type=str, required=True, help='''Path to the TensorFlow 2.x checkpoint path.'''
 )
 parser.add_argument(
     '''--bert_config_file''',
     type=str,
     required=True,
     help='''The config json file corresponding to the BERT model. This specifies the model architecture.''',
 )
 parser.add_argument(
     '''--pytorch_dump_path''',
     type=str,
     required=True,
     help='''Path to the output PyTorch model (must include filename).''',
 )
 __lowerCAmelCase			=							parser.parse_args()
 convert_tfa_checkpoint_to_pytorch(args.tf_checkpoint_path, args.bert_config_file, args.pytorch_dump_path)


