Update app.py
Browse files
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 =
|
36 |
-
"\n".join(["\n".join(["
|
37 |
for item in history])
|
38 |
# strip the last `<|end_of_turn|>` from the messages
|
39 |
-
messages = messages.rstrip("<|
|
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 |
|