Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -64,7 +64,8 @@ def stream_chat(message, history: list, temperature: float, max_new_tokens: int)
|
|
| 64 |
for prompt, answer in history:
|
| 65 |
if answer is None:
|
| 66 |
conversation.extend([{"role": "user", "content":"<|image_1|>"},{"role": "assistant", "content": ""}])
|
| 67 |
-
|
|
|
|
| 68 |
conversation.append({"role": "user", "content": message['text']})
|
| 69 |
print(f"Conversation is -\n{conversation}")
|
| 70 |
inputs = processor.tokenizer.apply_chat_template(conversation, tokenize=False, add_generation_prompt=True)
|
|
|
|
| 64 |
for prompt, answer in history:
|
| 65 |
if answer is None:
|
| 66 |
conversation.extend([{"role": "user", "content":"<|image_1|>"},{"role": "assistant", "content": ""}])
|
| 67 |
+
else:
|
| 68 |
+
conversation.extend([{"role": "user", "content": prompt}, {"role": "assistant", "content": answer}])
|
| 69 |
conversation.append({"role": "user", "content": message['text']})
|
| 70 |
print(f"Conversation is -\n{conversation}")
|
| 71 |
inputs = processor.tokenizer.apply_chat_template(conversation, tokenize=False, add_generation_prompt=True)
|