Update app.py
Browse files
app.py
CHANGED
@@ -36,13 +36,13 @@ def chat(history, system_message, max_tokens, temperature, top_p, top_k, repetit
|
|
36 |
|
37 |
if system_message.strip():
|
38 |
# if system_message is not None or empty
|
39 |
-
messages = "<|im_start|>"+"system\n" + system_message.strip() + "<|im_end|>\n" + \
|
40 |
-
"\n".join(["\n".join(["<|im_start|>"+"user\n"+item[0]+"<|im_end|>", "<|im_start|>assistant\n"+item[1]+"<|im_end|>"])
|
41 |
for item in history])
|
42 |
else:
|
43 |
# if system_message is None or empty, use BASE_SYSTEM_MESSAGE
|
44 |
-
messages = "<|im_start|>"+"system\n" + BASE_SYSTEM_MESSAGE + "<|im_end|>\n" + \
|
45 |
-
"\n".join(["\n".join(["<|im_start|>"+"user\n"+item[0]+"<|im_end|>", "<|im_start|>assistant\n"+item[1]+"<|im_end|>"])
|
46 |
for item in history])
|
47 |
# strip the last `<|end_of_turn|>` from the messages
|
48 |
messages = messages.rstrip("<|im_end|>")
|
|
|
36 |
|
37 |
if system_message.strip():
|
38 |
# if system_message is not None or empty
|
39 |
+
messages = "<|im_start|> "+"system\n" + system_message.strip() + "<|im_end|>\n" + \
|
40 |
+
"\n".join(["\n".join(["<|im_start|> "+"user\n"+item[0]+"<|im_end|>", "<|im_start|> assistant\n"+item[1]+"<|im_end|>"])
|
41 |
for item in history])
|
42 |
else:
|
43 |
# if system_message is None or empty, use BASE_SYSTEM_MESSAGE
|
44 |
+
messages = "<|im_start|> "+"system\n" + BASE_SYSTEM_MESSAGE + "<|im_end|>\n" + \
|
45 |
+
"\n".join(["\n".join(["<|im_start|> "+"user\n"+item[0]+"<|im_end|>", "<|im_start|> assistant\n"+item[1]+"<|im_end|>"])
|
46 |
for item in history])
|
47 |
# strip the last `<|end_of_turn|>` from the messages
|
48 |
messages = messages.rstrip("<|im_end|>")
|