inflaton commited on
Commit
4f5127e
·
1 Parent(s): b7ce602

refine llama-2 chat prompt

Browse files
Files changed (1) hide show
  1. app_modules/llm_chat_chain.py +5 -2
app_modules/llm_chat_chain.py CHANGED
@@ -12,8 +12,11 @@ def get_llama_2_prompt_template():
12
  B_INST, E_INST = "[INST]", "[/INST]"
13
  B_SYS, E_SYS = "<<SYS>>\n", "\n<</SYS>>\n\n"
14
 
15
- instruction = "Chat History:\n\n{chat_history} \n\nUser: {question}"
16
- system_prompt = "You are a helpful assistant, you always only answer for the assistant then you stop. Read the chat history to get context"
 
 
 
17
 
18
  SYSTEM_PROMPT = B_SYS + system_prompt + E_SYS
19
  prompt_template = B_INST + SYSTEM_PROMPT + instruction + E_INST
 
12
  B_INST, E_INST = "[INST]", "[/INST]"
13
  B_SYS, E_SYS = "<<SYS>>\n", "\n<</SYS>>\n\n"
14
 
15
+ instruction = "Chat History:\n\n{chat_history} \n\nUser: {question}\nAnswer in markdown:"
16
+ # system_prompt = "You are a helpful assistant, you always only answer for the assistant then you stop. Read the chat history to get context"
17
+ system_prompt = """\
18
+ You are a helpful, respectful and honest assistant. Always answer as helpfully as possible, while being safe. Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature.\n\nIf a question does not make any sense, or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information. \n\nDo not output any emotional expression. Read the chat history to get context.\
19
+ """
20
 
21
  SYSTEM_PROMPT = B_SYS + system_prompt + E_SYS
22
  prompt_template = B_INST + SYSTEM_PROMPT + instruction + E_INST