Spaces:
Running
on
Zero
Running
on
Zero
add generation prompt
#5
by
not-lain
- opened
app.py
CHANGED
@@ -77,7 +77,7 @@ def chat_llama3_8b(message: str,
|
|
77 |
conversation.extend([{"role": "user", "content": user}, {"role": "assistant", "content": assistant}])
|
78 |
conversation.append({"role": "user", "content": message})
|
79 |
|
80 |
-
input_ids = tokenizer.apply_chat_template(conversation, return_tensors="pt").to(model.device)
|
81 |
|
82 |
streamer = TextIteratorStreamer(tokenizer, timeout=10.0, skip_prompt=True, skip_special_tokens=True)
|
83 |
|
|
|
77 |
conversation.extend([{"role": "user", "content": user}, {"role": "assistant", "content": assistant}])
|
78 |
conversation.append({"role": "user", "content": message})
|
79 |
|
80 |
+
input_ids = tokenizer.apply_chat_template(conversation,add_generation_prompt=True, return_tensors="pt").to(model.device)
|
81 |
|
82 |
streamer = TextIteratorStreamer(tokenizer, timeout=10.0, skip_prompt=True, skip_special_tokens=True)
|
83 |
|