diff --git a/python/llm/example/CPU/LangChain/chat.py b/python/llm/example/CPU/LangChain/chat.py index b3695199..223529f1 100644 --- a/python/llm/example/CPU/LangChain/chat.py +++ b/python/llm/example/CPU/LangChain/chat.py @@ -30,7 +30,11 @@ def main(args): question = args.question model_path = args.model_path - template ="""{question}""" + # Below is the prompt format for LLaMa-2 according to + # https://huggingface.co/meta-llama/Llama-2-7b-chat-hf + # If you're using a different language model, + # please adjust the template according to its own model card. + template = """[INST] <>\n \n<>\n\n{question} [/INST]""" prompt = PromptTemplate(template=template, input_variables=["question"]) diff --git a/python/llm/example/GPU/LangChain/chat.py b/python/llm/example/GPU/LangChain/chat.py index 96df015f..4191c8ea 100644 --- a/python/llm/example/GPU/LangChain/chat.py +++ b/python/llm/example/GPU/LangChain/chat.py @@ -30,7 +30,11 @@ def main(args): question = args.question model_path = args.model_path - template ="""{question}""" + # Below is the prompt format for LLaMa-2 according to + # https://huggingface.co/meta-llama/Llama-2-7b-chat-hf + # If you're using a different language model, + # please adjust the template according to its own model card. + template = """[INST] <>\n \n<>\n\n{question} [/INST]""" prompt = PromptTemplate(template=template, input_variables=["question"])