cursus.steps.configs.config_sopa_instruction_tuning_step¶
SOPA Instruction Tuning Step Configuration with Self-Contained Derivation Logic
This module implements the configuration class for SageMaker SOPA (Stage Of Pre-training Alignment) Stage 2 instruction fine-tuning steps using a self-contained design where derived fields are private with read-only properties.
Fields are organized into three tiers: 1. Tier 1: Essential User Inputs - fields that users must explicitly provide 2. Tier 2: System Inputs with Defaults - fields with reasonable defaults that can be overridden 3. Tier 3: Derived Fields - fields calculated from other fields (private with properties)
Note: Most training/model hyperparameters (feature_columns, input_size, latent_size, batch_size, lr, epochs, etc.) are defined in SOPAInstructionTuningHyperparameters and serialized to a JSON file. They are NOT duplicated here. The builder loads them from the JSON at pipeline construction time.
Only infrastructure settings, filenames, and the task selector live in this config.
- class SOPAInstructionTuningConfig(*, author, bucket, role, region, service_name, pipeline_version, model_class='xgboost', current_date=<factory>, framework_version='2.1.0', py_version='py310', source_dir=None, enable_caching=False, use_secure_pypi=False, max_runtime_seconds=172800, project_root_folder, training_entry_point, task, training_instance_type='ml.p4d.24xlarge', training_instance_count=1, training_volume_size=50, training_data_filename='training_data.csv', pretrained_qformer='qformer', tabular_encoder_filename='autoencoder_model', hyperparameters_dict=<factory>, **extra_data)[source]¶
Bases:
BasePipelineConfigConfiguration specific to the SageMaker SOPA Instruction Tuning Step.
This configuration collects user inputs for SOPA Stage 2 instruction fine-tuning, which fine-tunes a BLIP2-based model (Q-Former + Phi-3 LLM) for tabular-to-text instruction following tasks. Input/output paths are provided via step specifications and dependencies.
Most training/model hyperparameters are defined separately in SOPAInstructionTuningHyperparameters and loaded from the hyperparameters JSON by the builder. This config only contains: - Infrastructure settings (instance type, count, volume) - Task selector - Filename overrides (training data, Q-Former checkpoint, tabular encoder checkpoint)
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'allow', 'protected_namespaces': (), 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- get_environment_variables()[source]¶
Get environment variables for the SOPA instruction tuning script.
The SOPA script uses argparse for all configuration and does not require environment variables.
- get_public_init_fields()[source]¶
Override get_public_init_fields to include SOPA instruction tuning-specific fields. Gets a dictionary of public fields suitable for initializing a child config. Includes both base fields (from parent) and SOPA-specific fields.
Note: Training/model hyperparameters (feature_columns, input_size, batch_size, lr, etc.) are NOT included here — they come from the hyperparameters JSON file.
- Returns:
Dictionary of field names to values for child initialization
- Return type:
Dict[str, Any]
- model_post_init(context, /)¶
This function is meant to behave like a BaseModel method to initialize private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
- Parameters:
self (BaseModel) – The BaseModel instance.
context (Any) – The context.