(parser)
| 24 | return tensor.detach().cpu().tolist() |
| 25 | |
| 26 | def register_args(parser): |
| 27 | # Required parameters |
| 28 | parser.add_argument( |
| 29 | "--dataset", |
| 30 | default=None, |
| 31 | type=str, |
| 32 | required=True, |
| 33 | help="dataset to operate on", |
| 34 | ) |
| 35 | parser.add_argument( |
| 36 | "--model_type", |
| 37 | default=None, |
| 38 | type=str, |
| 39 | required=True, |
| 40 | help="Model type", |
| 41 | ) |
| 42 | parser.add_argument( |
| 43 | "--model_name_or_path", |
| 44 | default=None, |
| 45 | type=str, |
| 46 | required=True, |
| 47 | help="Path to pretrained model or model identifier from huggingface.co/models", |
| 48 | ) |
| 49 | parser.add_argument( |
| 50 | "--output_dir", |
| 51 | default=None, |
| 52 | type=str, |
| 53 | required=True, |
| 54 | help="The output directory where the model checkpoints and predictions will be written.", |
| 55 | ) |
| 56 | |
| 57 | # Other parameters |
| 58 | parser.add_argument( |
| 59 | "--data_dir", |
| 60 | default=None, |
| 61 | type=str, |
| 62 | help="The input data dir. Should contain the .json files for the task." |
| 63 | + "If no data dir or train/predict files are specified, will run with tensorflow_datasets.", |
| 64 | ) |
| 65 | parser.add_argument( |
| 66 | "--train_file", |
| 67 | default=None, |
| 68 | type=str, |
| 69 | help="The input training file. If a data dir is specified, will look for the file there" |
| 70 | + "If no data dir or train/predict files are specified, will run with tensorflow_datasets.", |
| 71 | ) |
| 72 | parser.add_argument( |
| 73 | "--predict_file", |
| 74 | default=None, |
| 75 | type=str, |
| 76 | help="The input evaluation file. If a data dir is specified, will look for the file there" |
| 77 | + "If no data dir or train/predict files are specified, will run with tensorflow_datasets.", |
| 78 | ) |
| 79 | parser.add_argument( |
| 80 | "--config_name", default="", type=str, help="Pretrained config name or path if not the same as model_name" |
| 81 | ) |
| 82 | parser.add_argument( |
| 83 | "--tokenizer_name", |
nothing calls this directly
no outgoing calls
no test coverage detected