-
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 #23 from vtuber-plan/function
add mistral
- Loading branch information
Showing
17 changed files
with
203 additions
and
50 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from langport.data.conversation import ( | ||
ConversationSettings, | ||
SeparatorStyle, | ||
) | ||
|
||
|
||
# Mistral default template | ||
mistral = ConversationSettings( | ||
name="mistral", | ||
system_template="[INST]{system_message}\n", | ||
roles=("[INST]", "[/INST]"), | ||
sep_style=SeparatorStyle.LLAMA, | ||
sep=" ", | ||
sep2="</s>", | ||
) |
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,16 @@ | ||
from langport.data.conversation import ( | ||
ConversationSettings, | ||
SeparatorStyle, | ||
) | ||
|
||
|
||
# StarChat default template | ||
starchat = ConversationSettings( | ||
name="starchat", | ||
system_template="<system>\n{system_message}", | ||
roles=("<|user|>", "<|assistant|>"), | ||
sep_style=SeparatorStyle.ADD_NEW_LINE_SINGLE, | ||
sep="<|end|>\n", | ||
stop_token_ids=[0, 49155], | ||
stop_str="<|end|>", | ||
) |
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,19 @@ | ||
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 MistralAdapter(BaseAdapter): | ||
"""The model adapter for Mistral""" | ||
|
||
def match(self, model_path: str): | ||
return model_path.lower().startswith("mistral") | ||
|
||
def get_default_conv_template(self, model_path: str) -> ConversationHistory: | ||
settings = get_conv_settings("mistral") | ||
return ConversationHistory( | ||
system="", | ||
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
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
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 |
---|---|---|
@@ -1 +1 @@ | ||
LANGPORT_VERSION = "0.3.3" | ||
LANGPORT_VERSION = "0.3.7" |
Oops, something went wrong.