Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Llama2ChangAdapter #2510

Merged
merged 3 commits into from
Oct 9, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions fastchat/model/model_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1625,6 +1625,16 @@ def get_default_conv_template(self, model_path: str) -> Conversation:
return get_conv_template("phind")


class Llama2ChangAdapter(Llama2Adapter):
"""The model adapter for Llama2-ko-chang"""
merrymercy marked this conversation as resolved.
Show resolved Hide resolved

def match(self, model_path: str):
return "llama2-ko-chang" in model_path.lower()

def get_default_conv_template(self, model_path: str) -> Conversation:
return get_conv_template("polyglot_changgpt")


# Note: the registration order matters.
# The one registered earlier has a higher matching priority.
register_model_adapter(PeftModelAdapter)
Expand Down Expand Up @@ -1684,6 +1694,7 @@ def get_default_conv_template(self, model_path: str) -> Conversation:
register_model_adapter(ReaLMAdapter)
register_model_adapter(PhindCodeLlamaAdapter)
register_model_adapter(CodeLlamaAdapter)
register_model_adapter(Llama2ChangAdapter)

# After all adapters, try the default base adapter.
register_model_adapter(BaseModelAdapter)