Skip to content
Merged
Changes from all 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
14 changes: 7 additions & 7 deletions fastchat/model/model_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1362,12 +1362,10 @@ class OpenOrcaAdapter(BaseModelAdapter):
use_fast_tokenizer = False

def match(self, model_path: str):
if "mistral-7b-openorca" in model_path.lower():
return get_conv_template("mistral-7b-openorca")
elif "openorca" in model_path.lower():
return get_conv_template("open-orca")
else:
return False
return (
"mistral-7b-openorca" in model_path.lower()
or "openorca" in model_path.lower()
)

def load_model(self, model_path: str, from_pretrained_kwargs: dict):
revision = from_pretrained_kwargs.get("revision", "main")
Expand All @@ -1382,6 +1380,8 @@ def load_model(self, model_path: str, from_pretrained_kwargs: dict):
return model, tokenizer

def get_default_conv_template(self, model_path: str) -> Conversation:
if "mistral-7b-openorca" in model_path.lower():
return get_conv_template("mistral-7b-openorca")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In function def match(self, model_path: str):, it should return "True/Flase" instead of get_conv_template.
Could you fix it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. I will fix that in a bit.

Copy link
Contributor Author

@vjsrinath vjsrinath Nov 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@merrymercy Required changes have been made and pushed.

return get_conv_template("open-orca")


Expand Down Expand Up @@ -1770,9 +1770,9 @@ def get_default_conv_template(self, model_path: str) -> Conversation:
register_model_adapter(InternLMChatAdapter)
register_model_adapter(StarChatAdapter)
register_model_adapter(Llama2Adapter)
register_model_adapter(MistralAdapter)
register_model_adapter(CuteGPTAdapter)
register_model_adapter(OpenOrcaAdapter)
register_model_adapter(MistralAdapter)
register_model_adapter(WizardCoderAdapter)
register_model_adapter(QwenChatAdapter)
register_model_adapter(AquilaChatAdapter)
Expand Down