-
Notifications
You must be signed in to change notification settings - Fork 12
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 #16 from vtuber-plan/development
logprobs parameter implement
- Loading branch information
Showing
16 changed files
with
211 additions
and
28 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from langport.data.conversation import ( | ||
ConversationSettings, | ||
SeparatorStyle, | ||
) | ||
|
||
# Ningyu default template | ||
ningyu = ConversationSettings( | ||
name="ningyu", | ||
roles=("user", "assistant"), | ||
sep_style=SeparatorStyle.ADD_COLON_SINGLE, | ||
sep="\n### ", | ||
stop_str="###", | ||
) |
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,22 @@ | ||
from langport.data.conversation import ConversationHistory, SeparatorStyle | ||
from langport.data.conversation.conversation_settings import get_conv_settings | ||
from langport.model.model_adapter import BaseAdapter | ||
|
||
|
||
class NingYuAdapter(BaseAdapter): | ||
"""The model adapter for ningyu""" | ||
|
||
def match(self, model_path: str): | ||
return "ningyu" in model_path | ||
|
||
def get_default_conv_template(self, model_path: str) -> ConversationHistory: | ||
settings = get_conv_settings("ningyu") | ||
return ConversationHistory( | ||
system="""A chat between a curious user and an artificial intelligence assistant. | ||
The name of the assistant is NingYu (凝语). | ||
The assistant gives helpful, detailed, and polite answers to the user's questions.""", | ||
messages=[], | ||
offset=0, | ||
settings=settings, | ||
) | ||
|
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
Oops, something went wrong.