feat(model): Support mistral nemo (#1766)

This commit is contained in:
Fangyin Cheng
2024-08-01 18:42:01 +08:00
committed by GitHub
parent 7ea9b8c419
commit 78c912fd29
2 changed files with 15 additions and 0 deletions

View File

@@ -211,6 +211,9 @@ LLM_MODEL_CONFIG = {
"mixtral-8x7b-instruct-v0.1": os.path.join(
MODEL_PATH, "Mixtral-8x7B-Instruct-v0.1"
),
"mistral-nemo-instruct-2407": os.path.join(
MODEL_PATH, "Mistral-Nemo-Instruct-2407"
),
# https://huggingface.co/upstage/SOLAR-10.7B-Instruct-v1.0
"solar-10.7b-instruct-v1.0": os.path.join(MODEL_PATH, "SOLAR-10.7B-Instruct-v1.0"),
# https://huggingface.co/Open-Orca/Mistral-7B-OpenOrca
@@ -238,6 +241,7 @@ LLM_MODEL_CONFIG = {
"gemma-7b-it": os.path.join(MODEL_PATH, "gemma-7b-it"),
# https://huggingface.co/google/gemma-2b-it
"gemma-2b-it": os.path.join(MODEL_PATH, "gemma-2b-it"),
"gemma-2-2b-it": os.path.join(MODEL_PATH, "gemma-2-2b-it"),
"gemma-2-9b-it": os.path.join(MODEL_PATH, "gemma-2-9b-it"),
"gemma-2-27b-it": os.path.join(MODEL_PATH, "gemma-2-27b-it"),
"starling-lm-7b-beta": os.path.join(MODEL_PATH, "Starling-LM-7B-beta"),

View File

@@ -198,6 +198,16 @@ class Mixtral8x7BAdapter(NewHFChatModelAdapter):
)
class MistralNemo(NewHFChatModelAdapter):
def do_match(self, lower_model_name_or_path: Optional[str] = None):
return (
lower_model_name_or_path
and "mistral" in lower_model_name_or_path
and "nemo" in lower_model_name_or_path
and "instruct" in lower_model_name_or_path
)
class SOLARAdapter(NewHFChatModelAdapter):
"""
https://huggingface.co/upstage/SOLAR-10.7B-Instruct-v1.0
@@ -627,6 +637,7 @@ class Internlm2Adapter(NewHFChatModelAdapter):
register_model_adapter(YiAdapter)
register_model_adapter(Yi15Adapter)
register_model_adapter(Mixtral8x7BAdapter)
register_model_adapter(MistralNemo)
register_model_adapter(SOLARAdapter)
register_model_adapter(GemmaAdapter)
register_model_adapter(Gemma2Adapter)