| 179 | |
| 180 | |
| 181 | def parse_args(): |
| 182 | parser = argparse.ArgumentParser(description="Simple example of a training script.") |
| 183 | parser.add_argument( |
| 184 | "--input_perturbation", type=float, default=0, help="The scale of input perturbation. Recommended 0.1." |
| 185 | ) |
| 186 | parser.add_argument( |
| 187 | "--pretrained_model_name_or_path", |
| 188 | type=str, |
| 189 | default=None, |
| 190 | required=True, |
| 191 | help="Path to pretrained model or model identifier from huggingface.co/models.", |
| 192 | ) |
| 193 | parser.add_argument( |
| 194 | "--revision", |
| 195 | type=str, |
| 196 | default=None, |
| 197 | required=False, |
| 198 | help="Revision of pretrained model identifier from huggingface.co/models.", |
| 199 | ) |
| 200 | parser.add_argument( |
| 201 | "--variant", |
| 202 | type=str, |
| 203 | default=None, |
| 204 | help="Variant of the model files of the pretrained model identifier from huggingface.co/models, 'e.g.' fp16", |
| 205 | ) |
| 206 | parser.add_argument( |
| 207 | "--train_data_dir", |
| 208 | type=str, |
| 209 | default=None, |
| 210 | help=( |
| 211 | "A folder containing the training data. " |
| 212 | ), |
| 213 | ) |
| 214 | parser.add_argument( |
| 215 | "--train_data_meta", |
| 216 | type=str, |
| 217 | default=None, |
| 218 | help=( |
| 219 | "A csv containing the training data. " |
| 220 | ), |
| 221 | ) |
| 222 | parser.add_argument( |
| 223 | "--max_train_samples", |
| 224 | type=int, |
| 225 | default=None, |
| 226 | help=( |
| 227 | "For debugging purposes or quicker training, truncate the number of training examples to this " |
| 228 | "value if set." |
| 229 | ), |
| 230 | ) |
| 231 | parser.add_argument( |
| 232 | "--validation_prompts", |
| 233 | type=str, |
| 234 | default=None, |
| 235 | nargs="+", |
| 236 | help=("A set of prompts evaluated every `--validation_epochs` and logged to `--report_to`."), |
| 237 | ) |
| 238 | parser.add_argument( |