kabbi commited on
Commit
9c6afad
1 Parent(s): 15d5921

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -63,10 +63,13 @@ def stream_chat(
63
 
64
  conversation.append({"role": "user", "content": message})
65
 
66
- print(conversation)
67
-
68
- input_text=tokenizer.apply_chat_template(conversation, tokenize=False)
69
- inputs = tokenizer.encode(input_text, return_tensors="pt").to(device)
 
 
 
70
  streamer = TextIteratorStreamer(tokenizer, timeout=60.0, skip_prompt=True, skip_special_tokens=True)
71
 
72
  generate_kwargs = dict(
 
63
 
64
  conversation.append({"role": "user", "content": message})
65
 
66
+ input_ids = tokenizer.apply_chat_template(
67
+ conversation,
68
+ tokenize=True,
69
+ add_generation_prompt=True,
70
+ return_tensors="pt"
71
+ ).to(device)
72
+
73
  streamer = TextIteratorStreamer(tokenizer, timeout=60.0, skip_prompt=True, skip_special_tokens=True)
74
 
75
  generate_kwargs = dict(