bleysg commited on
Commit
99f44e2
1 Parent(s): faaf8fa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -32,11 +32,11 @@ def user(message, history):
32
  def chat(history, system_message, max_tokens, temperature, top_p, top_k, repetition_penalty):
33
  history = history or []
34
 
35
- messages = "<|im_start|>"+"system\n" + BASE_SYSTEM_MESSAGE + system_message.strip() + "<|im_end|>\n" + \
36
- "\n".join(["\n".join(["<|im_start|>"+"user\n"+item[0]+"<|im_end|>", "<|im_start|>assistant\n"+item[1]+"<|im_end|>"])
37
  for item in history])
38
  # strip the last `<|end_of_turn|>` from the messages
39
- messages = messages.rstrip("<|im_end|>")
40
  # remove last space from assistant, some models output a ZWSP if you leave a space
41
  messages = messages.rstrip()
42
 
 
32
  def chat(history, system_message, max_tokens, temperature, top_p, top_k, repetition_penalty):
33
  history = history or []
34
 
35
+ messages = BASE_SYSTEM_MESSAGE + system_message.strip() + "\n" + \
36
+ "\n".join(["\n".join(["User: "+item[0]+"<|end_of_turn|>", "Assistant: "+item[1]+"<|end_of_turn|>"])
37
  for item in history])
38
  # strip the last `<|end_of_turn|>` from the messages
39
+ messages = messages.rstrip("<|end_of_turn|>")
40
  # remove last space from assistant, some models output a ZWSP if you leave a space
41
  messages = messages.rstrip()
42