ruạṛ
a ���f�- � @ s8 d dl mZmZmZ d dlmZ eG dd� de��ZdS )� )�formatted_flat_dict� NONE_SENTINEL�#value_allowed_none_or_none_sentinel)�init_model_state_from_kwargsc @ s� e Zd ZdZdZdZdZdd� Zedd� �Z e d d � �Zejdd � �Ze dd � �Z e jdd � �Z e dd� �Zejdd� �Ze dd� �Zejdd� �Ze dd� �Zejdd� �Ze dd� �Zejdd� �Ze dd� �Zejdd� �Zdd� Zd d!� Zd"d#� Zd$S )%�TrainingConfigzY The fine-tuning method and hyperparameters used for fine-tuning a custom model. �TFEW_TRAINING_CONFIG�VANILLA_TRAINING_CONFIG�LORA_TRAINING_CONFIGc K sZ dddddddd�| _ ddddd d dd�| _d| _d| _d| _d| _d| _d| _d| _dS ) a Initializes a new TrainingConfig object with values from keyword arguments. This class has the following subclasses and if you are using this class as input to a service operations then you should favor using a subclass over the base class: * :class:`~oci.generative_ai.models.LoraTrainingConfig` * :class:`~oci.generative_ai.models.VanillaTrainingConfig` * :class:`~oci.generative_ai.models.TFewTrainingConfig` The following keyword arguments are supported (corresponding to the getters/setters of this class): :param training_config_type: The value to assign to the training_config_type property of this TrainingConfig. Allowed values for this property are: "TFEW_TRAINING_CONFIG", "VANILLA_TRAINING_CONFIG", "LORA_TRAINING_CONFIG", 'UNKNOWN_ENUM_VALUE'. Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. :type training_config_type: str :param total_training_epochs: The value to assign to the total_training_epochs property of this TrainingConfig. :type total_training_epochs: int :param learning_rate: The value to assign to the learning_rate property of this TrainingConfig. :type learning_rate: float :param training_batch_size: The value to assign to the training_batch_size property of this TrainingConfig. :type training_batch_size: int :param early_stopping_patience: The value to assign to the early_stopping_patience property of this TrainingConfig. :type early_stopping_patience: int :param early_stopping_threshold: The value to assign to the early_stopping_threshold property of this TrainingConfig. :type early_stopping_threshold: float :param log_model_metrics_interval_in_steps: The value to assign to the log_model_metrics_interval_in_steps property of this TrainingConfig. :type log_model_metrics_interval_in_steps: int �str�int�float)�training_config_type�total_training_epochs� learning_rate�training_batch_size�early_stopping_patience�early_stopping_threshold�#log_model_metrics_interval_in_steps�trainingConfigTypeZtotalTrainingEpochsZlearningRateZtrainingBatchSizeZearlyStoppingPatienceZearlyStoppingThresholdZlogModelMetricsIntervalInStepsN) Z swagger_typesZ attribute_map�_training_config_type�_total_training_epochs�_learning_rate�_training_batch_size�_early_stopping_patience�_early_stopping_threshold�$_log_model_metrics_interval_in_steps)�self�kwargs� r �L/usr/lib/python3.9/site-packages/oci/generative_ai/models/training_config.py�__init__ s. +�� zTrainingConfig.__init__c C s4 | d }|dkrdS |dkr dS |dkr,dS dS d S ) z� Given the hash representation of a subtype of this class, use the info in the hash to return the class of the subtype. r r ZLoraTrainingConfigr ZVanillaTrainingConfigr ZTFewTrainingConfigr Nr )Zobject_dictionary�typer r r �get_subtyped s zTrainingConfig.get_subtypec C s | j S )a� **[Required]** Gets the training_config_type of this TrainingConfig. The fine-tuning method for training a custom model. Allowed values for this property are: "TFEW_TRAINING_CONFIG", "VANILLA_TRAINING_CONFIG", "LORA_TRAINING_CONFIG", 'UNKNOWN_ENUM_VALUE'. Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. :return: The training_config_type of this TrainingConfig. :rtype: str )r �r r r r r w s z#TrainingConfig.training_config_typec C s g d�}t ||�sd}|| _dS )z� Sets the training_config_type of this TrainingConfig. The fine-tuning method for training a custom model. :param training_config_type: The training_config_type of this TrainingConfig. :type: str )r r r ZUNKNOWN_ENUM_VALUEN)r r )r r Zallowed_valuesr r r r � s c C s | j S )z� Gets the total_training_epochs of this TrainingConfig. The maximum number of training epochs to run for. :return: The total_training_epochs of this TrainingConfig. :rtype: int �r r# r r r r � s z$TrainingConfig.total_training_epochsc C s || _ dS )z� Sets the total_training_epochs of this TrainingConfig. The maximum number of training epochs to run for. :param total_training_epochs: The total_training_epochs of this TrainingConfig. :type: int Nr$ )r r r r r r � s c C s | j S )z� Gets the learning_rate of this TrainingConfig. The initial learning rate to be used during training :return: The learning_rate of this TrainingConfig. :rtype: float �r r# r r r r � s zTrainingConfig.learning_ratec C s || _ dS )z� Sets the learning_rate of this TrainingConfig. The initial learning rate to be used during training :param learning_rate: The learning_rate of this TrainingConfig. :type: float Nr% )r r r r r r � s c C s | j S )z� Gets the training_batch_size of this TrainingConfig. The batch size used during training. :return: The training_batch_size of this TrainingConfig. :rtype: int �r r# r r r r � s z"TrainingConfig.training_batch_sizec C s || _ dS )z� Sets the training_batch_size of this TrainingConfig. The batch size used during training. :param training_batch_size: The training_batch_size of this TrainingConfig. :type: int Nr&