Skip to content

Commit

Permalink
feat(model): Support mistral nemo (#1766)
Browse files Browse the repository at this point in the history
  • Loading branch information
fangyinc authored Aug 1, 2024
1 parent 7ea9b8c commit 78c912f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dbgpt/configs/model_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,9 @@ def get_device() -> str:
"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
Expand Down Expand Up @@ -238,6 +241,7 @@ def get_device() -> str:
"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"),
Expand Down
11 changes: 11 additions & 0 deletions dbgpt/model/adapter/hf_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,16 @@ def do_match(self, lower_model_name_or_path: Optional[str] = None):
)


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
Expand Down Expand Up @@ -627,6 +637,7 @@ def load(self, model_path: str, from_pretrained_kwargs: dict):
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)
Expand Down

0 comments on commit 78c912f

Please sign in to comment.