sagemaker.train.common#
Classes
|
Customization techniques for fine-tuning. |
|
Dynamic class for fine-tuning options with validation. |
|
Training types for fine-tuning. |
- class sagemaker.train.common.CustomizationTechnique(value)[source]#
Bases:
EnumCustomization techniques for fine-tuning.
- CPT = 'CPT'#
- DPO = 'DPO'#
- RLAIF = 'RLAIF'#
- RLVR = 'RLVR'#
- SFT = 'SFT'#
- class sagemaker.train.common.FineTuningOptions(options_dict: Dict[str, Any], sequence_length: int | None = None)[source]#
Bases:
objectDynamic class for fine-tuning options with validation.
- to_dict() Dict[str, Any][source]#
Convert back to dictionary for hyperparameters with string values.
- to_user_dict() Dict[str, Any][source]#
Return only user-explicitly-set hyperparameters as string key-value pairs.
- validate_length_constraints()[source]#
Enforce that selected lengths fit the recipe’s sequence_length.
For RL recipes: max_prompt_length + max_response_length must not exceed sequence_length. For SFT/DPO: the single-example length (dataset_max_len) must not exceed it. Per-field min/max are already enforced on assignment; this adds the cross-field sum check that a per-field max cannot express.
Framework-agnostic: gated only on the recipe’s sequence_length metadata, not on the model family. No-op if sequence_length is unknown or the relevant params are absent.