Source code for lmflow.utils.conversation_template.yi

#!/usr/bin/env python
# coding=utf-8
# Copyright 2024 Statistics and Machine Learning Research Group. All rights reserved.
from .base import StringFormatter, TemplateComponent, ConversationTemplate


[docs] YI1_5_TEMPLATE = ConversationTemplate( template_name='yi1_5', user_formatter=StringFormatter( template=[ TemplateComponent(type='string', content='<|im_start|>user\n{{content}}<|im_end|>\n') ] ), assistant_formatter=StringFormatter( template=[ TemplateComponent(type='string', content='<|im_start|>assistant\n{{content}}<|im_end|>\n') ] ), system_formatter=StringFormatter( template=[ TemplateComponent(type='string', content='{{content}}') ] ) )