Gkunsch commited on
Commit
5982f31
β€’
1 Parent(s): 634ef5f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -2
app.py CHANGED
@@ -77,8 +77,7 @@ def stream_chat(
77
  conversation.append({"role": "user", "content": message})
78
 
79
 
80
- input_text = tokenizer.apply_chat_template(conversation, tokenize=False)
81
- input_text += "<|im_start|>assistant\n"
82
 
83
  inputs = tokenizer.encode(input_text, return_tensors="pt").to(device)
84
  streamer = TextIteratorStreamer(tokenizer, timeout=60.0, skip_prompt=True, skip_special_tokens=True)
 
77
  conversation.append({"role": "user", "content": message})
78
 
79
 
80
+ input_text = tokenizer.apply_chat_template(conversation, tokenize=False, add_generation_prompt = True)
 
81
 
82
  inputs = tokenizer.encode(input_text, return_tensors="pt").to(device)
83
  streamer = TextIteratorStreamer(tokenizer, timeout=60.0, skip_prompt=True, skip_special_tokens=True)