File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Filter options
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Original file line number Diff line number Diff line change @@ -696,10 +696,12 @@ def create_chat_completion(
696
696
Generated chat completion or a stream of chat completion chunks.
697
697
"""
698
698
stop = stop if stop is not None else []
699
+ chat_history = "" .join (
700
+ f'### { "Human" if message ["role" ] == "user" else "Assistant" } :{ message ["content" ]} '
699
701
for message in messages
700
702
)
701
- PROMPT = f" \n \n ### Instructions: { instructions } \n \n ### Inputs: { chat_history } \n \n ### Response: \n assistant: "
702
- PROMPT_STOP = ["###" , " \n user: " , "\n assistant: " , "\n system: " ]
703
+ PROMPT = chat_history + " ### Assistant: "
704
+ PROMPT_STOP = ["### Assistant: " , "### Human: " , "\n " ]
703
705
completion_or_chunks = self (
704
706
prompt = PROMPT ,
705
707
stop = PROMPT_STOP + stop ,
You can’t perform that action at this time.
0 commit comments