Skip to content

Commit

Permalink
feat(model): Support llama-3-sqlcoder-8b (#1559)
Browse files Browse the repository at this point in the history
  • Loading branch information
fangyinc authored May 25, 2024
1 parent 83d7e9d commit 82ed461
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions dbgpt/configs/model_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ def get_device() -> str:
"phi-3-small-8k-instruct": os.path.join(MODEL_PATH, "Phi-3-small-8k-instruct"),
"phi-3-mini-128k-instruct": os.path.join(MODEL_PATH, "Phi-3-mini-128k-instruct"),
"phi-3-mini-4k-instruct": os.path.join(MODEL_PATH, "Phi-3-mini-4k-instruct"),
"llama-3-sqlcoder-8b": os.path.join(MODEL_PATH, "llama-3-sqlcoder-8b"),
}

EMBEDDING_MODEL_CONFIG = {
Expand Down
14 changes: 14 additions & 0 deletions dbgpt/model/adapter/hf_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,19 @@ def get_str_prompt(
return str_prompt


class SQLCoderAdapter(Llama3Adapter):
"""
https://huggingface.co/defog/llama-3-sqlcoder-8b
"""

def do_match(self, lower_model_name_or_path: Optional[str] = None):
return (
lower_model_name_or_path
and "llama-3" in lower_model_name_or_path
and "sqlcoder" in lower_model_name_or_path
)


# The following code is used to register the model adapter
# The last registered model adapter is matched first
register_model_adapter(YiAdapter)
Expand All @@ -465,3 +478,4 @@ def get_str_prompt(
register_model_adapter(DeepseekV2Adapter)
register_model_adapter(SailorAdapter)
register_model_adapter(PhiAdapter)
register_model_adapter(SQLCoderAdapter)

0 comments on commit 82ed461

Please sign in to comment.