update alpaca_chat prompts for instructions to explainn the conversation
This commit is contained in:
@@ -20,11 +20,24 @@ def load(tokenizer, cfg):
|
|||||||
|
|
||||||
class AlpacaConcisePrompter(AlpacaPrompter):
|
class AlpacaConcisePrompter(AlpacaPrompter):
|
||||||
"""
|
"""
|
||||||
Alpaca Prompter extending the system prompt to ask for concise answers
|
Alpaca Prompter extending the system prompt to ask for concise chat-instruct answers
|
||||||
"""
|
"""
|
||||||
|
|
||||||
system_prompt = "Below is an instruction that describes a task, paired with an input that provides further context. Write a response that concisely and appropriately completes the request.\n\n"
|
system_prompt = "Below is an instruction from a USER that describes a task, paired with an input that provides further context. The ASSISTANT writes a response that concisely and appropriately completes the request.\n\n"
|
||||||
system_no_input_prompt = "Below is an instruction that describes a task. Write a response that appropriately and concisely completes the request.\n\n"
|
system_no_input_prompt = "Below is an instruction from a USER that describes a task. The ASSISTANT writes a response that appropriately and concisely completes the request.\n\n"
|
||||||
|
|
||||||
|
|
||||||
|
class AlpacaChatPrompter(AlpacaPrompter):
|
||||||
|
"""
|
||||||
|
Alpaca Chat Prompter extending the system prompt to for chat-instruct answers
|
||||||
|
"""
|
||||||
|
|
||||||
|
system_prompt = "Below is an instruction from a USER that describes a task, paired with an input that provides further context. The ASSISTANT writes a response that concisely and appropriately completes the request.\n\n"
|
||||||
|
system_no_input_prompt = "Below is an instruction from a USER that describes a task. The ASSISTANT writes a response that appropriately and concisely completes the request.\n\n"
|
||||||
|
|
||||||
|
def __init__(self): # pylint: disable=super-init-not-called
|
||||||
|
self.prompt_style = PromptStyle.CHAT.value
|
||||||
|
self.match_prompt_style()
|
||||||
|
|
||||||
|
|
||||||
class AlpacaQAPromptTokenizingStrategy(InstructionPromptTokenizingStrategy):
|
class AlpacaQAPromptTokenizingStrategy(InstructionPromptTokenizingStrategy):
|
||||||
@@ -64,7 +77,7 @@ def load_concise(tokenizer, cfg):
|
|||||||
|
|
||||||
def load_qa(tokenizer, cfg):
|
def load_qa(tokenizer, cfg):
|
||||||
return AlpacaQAPromptTokenizingStrategy(
|
return AlpacaQAPromptTokenizingStrategy(
|
||||||
AlpacaPrompter(PromptStyle.CHAT.value),
|
AlpacaChatPrompter(),
|
||||||
tokenizer,
|
tokenizer,
|
||||||
cfg.train_on_inputs,
|
cfg.train_on_inputs,
|
||||||
cfg.sequence_len,
|
cfg.sequence_len,
|
||||||
@@ -73,7 +86,7 @@ def load_qa(tokenizer, cfg):
|
|||||||
|
|
||||||
def load_camel_ai(tokenizer, cfg):
|
def load_camel_ai(tokenizer, cfg):
|
||||||
return CamelAIPromptTokenizingStrategy(
|
return CamelAIPromptTokenizingStrategy(
|
||||||
AlpacaPrompter(PromptStyle.CHAT.value),
|
AlpacaChatPrompter(),
|
||||||
tokenizer,
|
tokenizer,
|
||||||
cfg.train_on_inputs,
|
cfg.train_on_inputs,
|
||||||
cfg.sequence_len,
|
cfg.sequence_len,
|
||||||
|
|||||||
Reference in New Issue
Block a user