Update app.py
Browse files
app.py
CHANGED
@@ -31,7 +31,7 @@ def chat(message, history):
|
|
31 |
if item[1] is not None:
|
32 |
chat.append({"role": "assistant", "content": item[1]})
|
33 |
chat.append({"role": "user", "content": message})
|
34 |
-
messages = tok.apply_chat_template(chat, tokenize=False)
|
35 |
# Tokenize the messages string
|
36 |
model_inputs = tok([messages], return_tensors="pt").to(device)
|
37 |
streamer = TextIteratorStreamer(
|
|
|
31 |
if item[1] is not None:
|
32 |
chat.append({"role": "assistant", "content": item[1]})
|
33 |
chat.append({"role": "user", "content": message})
|
34 |
+
messages = tok.apply_chat_template(chat, tokenize=False, add_generation_prompt=True)
|
35 |
# Tokenize the messages string
|
36 |
model_inputs = tok([messages], return_tensors="pt").to(device)
|
37 |
streamer = TextIteratorStreamer(
|