
    h]                     P    S SK JrJr  S SKJrJr  S SKJr  \ " S S\5      5       rg)    )	dataclassfield)AnyOptional)TrainingArgumentsc                   .  ^  \ rS rSr% Sr\R                  S/-   r\" SSS0S9r\	\
S'   \" S	SS
0S9r\\
S'   \" SSS0S9r\\   \
S'   \" SSS0S9r\\\\4      \
S'   \" SSS0S9r\\   \
S'   \" SSS0S9r\\
S'   \" SSS0S9r\\
S'   U 4S jrSrU =r$ )IterativeSFTConfig   a  
Configuration class for the [`IterativeSFTTrainer`].

<Tip warning={true}>

The [`IterativeSFTTrainer`] is deprecated and will be removed in version 0.24.0. Please use the [`SFTTrainer`].

</Tip>

This class includes only the parameters that are specific to Iterative SFT training. For a full list of training
arguments, please refer to the [`~transformers.TrainingArguments`] documentation. Note that default values in this
class may differ from those in [`~transformers.TrainingArguments`].

Using [`~transformers.HfArgumentParser`] we can turn this class into
[argparse](https://docs.python.org/3/library/argparse#module-argparse) arguments that can be specified on the
command line.

Parameters:
    > Parameters that control the model

    model_init_kwargs (`dict[str, Any]` or `None`, *optional*, defaults to `None`):
        Keyword arguments for [`~transformers.AutoModelForCausalLM.from_pretrained`], used when the `model`
        argument of the [`IterativeSFTTrainer`] is provided as a string.

    > Parameters that control the data preprocessing

    max_length (`int` or `None`, *optional*, defaults to `None`):
        Maximum length of the tokenized sequence. Sequences longer than `max_length` are truncated.
    truncation_mode (`str`, *optional*, defaults to `"keep_end"`):
        The truncation mode to use, either `"keep_end"` or `"keep_start"`.
    optimize_device_cache (`bool`, *optional*, defaults to `False`):
        Whether to optimize accelerator cache for slightly more memory-efficient training.
model_init_kwargs
   helpzLog every X updates steps. Should be an integer or a float in range `[0,1)`. If smaller than 1, will be interpreted as ratio of total training steps.)defaultmetadatalogging_stepsTzZIf True, use gradient checkpointing to save memory at the expense of slower backward pass.gradient_checkpointingNzWhether to use bf16 (mixed) precision instead of 32-bit. Requires Ampere or higher NVIDIA architecture or Intel XPU or using CPU (use_cpu) or Ascend NPU. If not set, it defaults to `True` if `fp16` is not set.bf16zKeyword arguments for `AutoModelForCausalLM.from_pretrained`, used when the `model` argument of the `IterativeSFTTrainer` is provided as a string.z[Maximum length of the tokenized sequence. Sequences longer than `max_length` are truncated.
max_lengthkeep_endz>The truncation mode to use, either 'keep_end' or 'keep_start'.truncation_modeFzRWhether to optimize accelerator cache for slightly more memory-efficient training.optimize_device_cachec                    > U R                   c  U R                  (       + OU R                   U l         [        TU ]  5         U R                  S;  a  [        SU R                   35      eg )N)r   
keep_startz?truncation_mode must be either 'keep_end' or 'keep_start', got )r   fp16super__post_init__r   
ValueError)self	__class__s    Z/home/james-whalen/.local/lib/python3.13/site-packages/trl/trainer/iterative_sft_config.pyr    IterativeSFTConfig.__post_init__k   sZ    '+yy'8Odii	'AA^_c_s_s^tuvv B    )r   )__name__
__module____qualname____firstlineno____doc__r   _VALID_DICT_FIELDSr   r   float__annotations__r   boolr   r   r   dictstrr   r   intr   r   r   __static_attributes____classcell__)r   s   @r   r	   r	      s/    D +==AT@UU ! D
M5  $)p
$D  ! !
D(4.  38 A
3xS#X/  !&q
!J  !Z[OS  #(no#4 
w wr!   r	   N)	dataclassesr   r   typingr   r   transformersr   r	    r!   r   <module>r4      s2    )   * [w* [w [wr!   