dmayhem93 commited on
Commit
d9b8972
1 Parent(s): 00572fe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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(