| 27 | |
| 28 | |
| 29 | def parse_args(): |
| 30 | parser = argparse.ArgumentParser(description='export a model') |
| 31 | parser.add_argument( |
| 32 | 'config', help='config file path', type=str, default=None) |
| 33 | parser.add_argument( |
| 34 | 'ckpt_path', type=str, help='checkpoint to be exported') |
| 35 | parser.add_argument( |
| 36 | 'export_path', type=str, help='file to store the exported model') |
| 37 | parser.add_argument('--local_rank', type=int, default=0) |
| 38 | parser.add_argument( |
| 39 | '--model_type', |
| 40 | type=str, |
| 41 | default=None, |
| 42 | help= |
| 43 | 'parameterize param when user specific choose a model config template like CLASSIFICATION: classification.py' |
| 44 | ) |
| 45 | parser.add_argument( |
| 46 | '--user_config_params', |
| 47 | nargs=argparse.REMAINDER, |
| 48 | default=None, |
| 49 | help='modify config options using the command-line') |
| 50 | args = parser.parse_args() |
| 51 | return args |
| 52 | |
| 53 | |
| 54 | def main(): |