o
    …wÖi)  ã                   @   s\   d dl mZmZ d dlmZ d dlmZmZ G dd„ deƒZeeeƒdedefdd	„ƒZ	d
S )é    )ÚCutÚMixedCut)Úregistered_prompt_format_fn)ÚModalityÚPromptFormatterc                   @   s<   e Zd ZdZdZdZdddejidœeddejidœiZdS )	ÚPlainPromptFormatterz`
    Plain prompt formatter: there is nothing being added to the user and assistants turns.
    ÚplainÚ	assistantÚuserz	|message|Úmessage)ÚtemplateÚslotsN)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚNAMEÚOUTPUT_ROLEr   ÚTextÚTEMPLATE© r   r   úb/home/ubuntu/sommelier/.venv/lib/python3.10/site-packages/nemo/collections/common/prompts/plain.pyr      s    ÿþÿþùr   ÚcutÚpromptc                 C   sh   t | tƒr| j} |  d¡r| j}nd}dd|idœg}| jd j }d ur/| dd|idœ¡ | |¡S )NÚcontextÚ r
   r   )Úroler   r   r	   )	Ú
isinstancer   Úfirst_non_padding_cutÚ
has_customr   ÚsupervisionsÚtextÚappendÚencode_dialog)r   r   ÚctxÚturnsÚanswerr   r   r   r   +   s   


r   N)
Ú
lhotse.cutr   r   Ú&nemo.collections.common.data.prompt_fnr   Ú)nemo.collections.common.prompts.formatterr   r   r   r   r   r   r   r   Ú<module>   s   