alfredplpl
commited on
Commit
•
e6c0406
1
Parent(s):
1addc60
Update app.py
Browse files
app.py
CHANGED
@@ -70,7 +70,7 @@ def chat_llama3_8b(message: str,
|
|
70 |
conversation.extend([{"role": "user", "content": user}, {"role": "assistant", "content": assistant}])
|
71 |
conversation.append({"role": "user", "content": message})
|
72 |
|
73 |
-
input_ids = tokenizer.apply_chat_template(conversation, return_tensors="pt").to(model.device)
|
74 |
|
75 |
streamer = TextIteratorStreamer(tokenizer, timeout=10.0, skip_prompt=True, skip_special_tokens=True)
|
76 |
|
|
|
70 |
conversation.extend([{"role": "user", "content": user}, {"role": "assistant", "content": assistant}])
|
71 |
conversation.append({"role": "user", "content": message})
|
72 |
|
73 |
+
input_ids = tokenizer.apply_chat_template(conversation, add_generation_prompt=True,return_tensors="pt").to(model.device)
|
74 |
|
75 |
streamer = TextIteratorStreamer(tokenizer, timeout=10.0, skip_prompt=True, skip_special_tokens=True)
|
76 |
|