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

feat(model): Support mistral nemo #1766

Merged
merged 1 commit into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
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
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
Loading