-
Notifications
You must be signed in to change notification settings - Fork 833
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #824 from OptimalScale/yizhenjia-template-update
Support yi and yi1.5 template
- Loading branch information
Showing
5 changed files
with
94 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env python | ||
# coding=utf-8 | ||
# Copyright 2024 Statistics and Machine Learning Research Group. All rights reserved. | ||
from .base import StringFormatter, TemplateComponent, ConversationTemplate | ||
|
||
|
||
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}}') | ||
] | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters