| 134 | |
| 135 | @dataclass |
| 136 | class TrainingArguments(transformers.Seq2SeqTrainingArguments): |
| 137 | cache_dir: Optional[str] = field( |
| 138 | default=None |
| 139 | ) |
| 140 | train_on_source: Optional[bool] = field( |
| 141 | default=False, |
| 142 | metadata={"help": "Whether to train on the input in addition to the target text."} |
| 143 | ) |
| 144 | do_mmlu_eval: Optional[bool] = field( |
| 145 | default=False, |
| 146 | metadata={"help": "Whether to run the MMLU evaluation."} |
| 147 | ) |
| 148 | do_ppl_eval: Optional[bool] = field( |
| 149 | default=False, |
| 150 | metadata={"help": "Whether to run the PPL evaluation."} |
| 151 | ) |
| 152 | pt_context_len: int = field( |
| 153 | default=1024, |
| 154 | metadata={"help": "language modeling length."} |
| 155 | ) |
| 156 | full_finetune: bool = field( |
| 157 | default=False, |
| 158 | metadata={"help": "Finetune the entire model without adapters."} |
| 159 | ) |
| 160 | wbits: int = field( |
| 161 | default=4, |
| 162 | metadata={"help": "How many bits to use."} |
| 163 | ) |
| 164 | group_size: int = field( |
| 165 | default=64, |
| 166 | metadata={"help": "How many group size to use."} |
| 167 | ) |
| 168 | max_memory_MB: int = field( |
| 169 | default=80000, |
| 170 | metadata={"help": "Free memory per gpu."} |
| 171 | ) |
| 172 | report_to: str = field( |
| 173 | default='none', |
| 174 | metadata={"help": "To use wandb or something else for reporting."} |
| 175 | ) |
| 176 | output_dir: str = field(default='./output', metadata={"help": 'The output dir for logs and checkpoints'}) |
| 177 | resume_from_checkpoint: str = field(default=None, metadata={"help": 'The output dir for logs and checkpoints'}) |
| 178 | optim: str = field(default='paged_adamw_32bit', metadata={"help": 'The optimizer to be used'}) |
| 179 | per_device_train_batch_size: int = field(default=1, metadata={"help": 'The training batch size per GPU. Increase for better speed.'}) |
| 180 | gradient_accumulation_steps: int = field(default=16, metadata={"help": 'How many gradients to accumulate before to perform an optimizer step'}) |
| 181 | max_steps: int = field(default=0, metadata={"help": 'How many optimizer update steps to take'}) |
| 182 | weight_decay: float = field(default=0.0, metadata={"help": 'The L2 weight decay rate of AdamW'}) # use lora dropout instead for regularization if needed |
| 183 | learning_rate: float = field(default=2e-5, metadata={"help": 'The learnign rate'}) |
| 184 | remove_unused_columns: bool = field(default=False, metadata={"help": 'Removed unused columns. Needed to make this codebase work.'}) |
| 185 | max_grad_norm: float = field(default=0.3, metadata={"help": 'Gradient clipping max norm. This is tuned and works well for all models tested.'}) |
| 186 | gradient_checkpointing: bool = field(default=True, metadata={"help": 'Use gradient checkpointing. You want to use this.'}) |
| 187 | do_train: bool = field(default=True, metadata={"help": 'To train or not to train, that is the question?'}) |
| 188 | lr_scheduler_type: str = field(default='cosine', metadata={"help": 'Learning rate schedule. Constant a bit better than cosine, and has advantage for analysis'}) |
| 189 | warmup_ratio: float = field(default=0.03, metadata={"help": 'Fraction of steps to do a warmup for'}) |
| 190 | logging_steps: int = field(default=10, metadata={"help": 'The frequency of update steps after which to log the loss'}) |
| 191 | group_by_length: bool = field(default=False, metadata={"help": 'Group sequences into batches with same length. Saves memory and speeds up training considerably.'}) |
| 192 | save_strategy: str = field(default='epoch', metadata={"help": 'When to save checkpoints'}) |
| 193 | save_steps: int = field(default=250, metadata={"help": 'How often to save a model'}) |
nothing calls this directly
no outgoing calls
no test coverage detected