§
    ÇPƒiª  ã                   óJ   — d dl mZ  G d„ de¦  «        Z G d„ de¦  «        ZdS )é    )ÚProtocolc                   ó:   — e Zd ZdZd	d„Zd	d„Zd	d„Zd	d„Zd	d„ZdS )
ÚFTRecipeInterfacea  
    This class provides a loose structure which every LLM fine-tuning recipe
    should follow. Please note that the interface itself should not be a vehicle for
    code reuse. torchtune strictly prohibits implementation inheritance in the codebase.

    A few notes about the design and the need for this interface:
    - This interface is meant to help recipe-writers organize their code in a way
        which is easy to read, understand and extend. Minimizing code duplication is not
        the goal. Recipe-writers are encouraged to copy-paste-modify.

    - This interface is not meant to add constraints. If the interface comes in the
        way of doing stuff, it needs to be updated or a new interface should be
        written to support what might be a new "family" of recipes.
    ÚreturnNc                 ó   — dS )zÜ
        Responsible for loading ALL of the state for the recipe from the
        checkpoint file, including state for the model, optimizer, dataloader and training
        parameters such as the epoch and seed.
        N© ©ÚselfÚkwargss     úo/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/torchtune/recipe_interfaces.pyÚload_checkpointz!FTRecipeInterface.load_checkpoint   ó	   € ð 	ˆó    c                 ó   — dS )z 
        Responsible for setting up all of the components necessary for training. This includes
        model, optimizer, loss function and dataloader.
        Nr   r	   s     r   ÚsetupzFTRecipeInterface.setup"   ó	   € ð
 	ˆr   c                 ó   — dS )z„
        All of the training logic, including the core loop, loss computation, gradient
        accumulation, and backward.
        Nr   r	   s     r   ÚtrainzFTRecipeInterface.train)   r   r   c                 ó   — dS )zÂ
        Responsible for saving ALL of the state for the recipe,
        including state for the model, optimizer, dataloader and training
        parameters such as the epoch and seed.
        Nr   r	   s     r   Úsave_checkpointz!FTRecipeInterface.save_checkpoint0   r   r   c                 ó   — dS )z8
        Any cleaning up needed for the recipe.
        Nr   r	   s     r   ÚcleanupzFTRecipeInterface.cleanup8   ó	   € ð 	ˆr   ©r   N)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r   r   r   r   
   s‚   € € € € € ðð ðð ð ð ðð ð ð ðð ð ð ðð ð ð ðð ð ð ð ð r   r   c                   ó*   — e Zd ZdZdd„Zdd„Zdd„ZdS )ÚEvalRecipeInterfacezÿ
    This class provides a loose structure which every LLM evaluation recipe
    should follow. Please note that the interface itself should not be a vehicle for
    code reuse. torchtune strictly prohibits implementation inheritance in the codebase.
    r   Nc                 ó   — dS )zk
        Responsible for loading ALL of the state for the recipe from the
        checkpoint file.
        Nr   r	   s     r   r   z#EvalRecipeInterface.load_checkpointF   r   r   c                 ó   — dS )z\
        Responsible for setting up all of the components necessary for evaluation.
        Nr   r	   s     r   r   zEvalRecipeInterface.setupM   r   r   c                 ó   — dS )zC
        All of the evaluation logic, including reporting.
        Nr   r	   s     r   ÚevaluatezEvalRecipeInterface.evaluateS   r   r   r   )r   r   r   r   r   r   r$   r   r   r   r    r    ?   sZ   € € € € € ðð ðð ð ð ðð ð ð ðð ð ð ð ð r   r    N)Útypingr   r   r    r   r   r   ú<module>r&      sx   ðð Ð Ð Ð Ð Ð ð2ð 2ð 2ð 2ð 2˜ñ 2ô 2ð 2ðjð ð ð ð ˜(ñ ô ð ð ð r   