mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-08-01 16:18:27 +00:00
add conv judge
This commit is contained in:
parent
17e21a395b
commit
3233e260b2
@ -82,11 +82,6 @@ LLM_MODEL_CONFIG = {
|
||||
"codellama-7b-sql-sft": os.path.join(MODEL_PATH, "codellama-7b-sql-sft"),
|
||||
"codellama-13b": os.path.join(MODEL_PATH, "CodeLlama-13b-Instruct-hf"),
|
||||
"codellama-13b-sql-sft": os.path.join(MODEL_PATH, "codellama-13b-sql-sft"),
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# For test now
|
||||
"opt-125m": os.path.join(MODEL_PATH, "opt-125m"),
|
||||
}
|
||||
|
@ -319,8 +319,9 @@ class Llama2Adapter(BaseLLMAdaper):
|
||||
model.config.pad_token_id = tokenizer.pad_token_id
|
||||
return model, tokenizer
|
||||
|
||||
|
||||
class CodeLlamaAdapter(BaseLLMAdaper):
|
||||
"""The model adapter for codellama """
|
||||
"""The model adapter for codellama"""
|
||||
|
||||
def match(self, model_path: str):
|
||||
return "codellama" in model_path.lower()
|
||||
|
@ -360,7 +360,6 @@ register_conv_template(
|
||||
)
|
||||
|
||||
|
||||
|
||||
# Alpaca default template
|
||||
register_conv_template(
|
||||
Conversation(
|
||||
|
@ -48,7 +48,7 @@ _OLD_MODELS = [
|
||||
"codellama-13b-sql-sft",
|
||||
"codellama-7b",
|
||||
"codellama-7b-sql-sft",
|
||||
"codellama-13b"
|
||||
"codellama-13b",
|
||||
]
|
||||
|
||||
|
||||
@ -152,8 +152,12 @@ class LLMModelAdaper:
|
||||
conv.append_message(conv.roles[1], content)
|
||||
else:
|
||||
raise ValueError(f"Unknown role: {role}")
|
||||
|
||||
if system_messages:
|
||||
conv.set_system_message("".join(system_messages))
|
||||
if isinstance(conv, Conversation):
|
||||
conv.set_system_message("".join(system_messages))
|
||||
else:
|
||||
conv.update_system_message("".join(system_messages))
|
||||
|
||||
# Add a blank message for the assistant.
|
||||
conv.append_message(conv.roles[1], None)
|
||||
|
@ -213,10 +213,11 @@ class Llama2ChatAdapter(BaseChatAdpter):
|
||||
|
||||
def get_conv_template(self, model_path: str) -> Conversation:
|
||||
return get_conv_template("llama-2")
|
||||
|
||||
|
||||
|
||||
class CodeLlamaChatAdapter(BaseChatAdpter):
|
||||
"""The model ChatAdapter for codellama ."""
|
||||
|
||||
def match(self, model_path: str):
|
||||
return "codellama" in model_path.lower()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user