Spaces:
Runtime error
Runtime error
Commit ·
99d0084
1
Parent(s): 24b913e
Update custom_llm.py
Browse files- custom_llm.py +2 -1
custom_llm.py
CHANGED
|
@@ -49,7 +49,8 @@ def custom_chain_with_history(llm, memory):
|
|
| 49 |
|
| 50 |
def prompt_memory(_):
|
| 51 |
t = ""
|
| 52 |
-
for x in memory.chat_memory.messages:
|
|
|
|
| 53 |
t += f"<|assistant|>\n<s>{x.content}</s>\n" if type(x) is AIMessage else f"<|user|>\n{x.content}\n"
|
| 54 |
return "" if len(t) == 0 else t
|
| 55 |
|
|
|
|
| 49 |
|
| 50 |
def prompt_memory(_):
|
| 51 |
t = ""
|
| 52 |
+
# for x in memory.chat_memory.messages:
|
| 53 |
+
for x in memory.messages:
|
| 54 |
t += f"<|assistant|>\n<s>{x.content}</s>\n" if type(x) is AIMessage else f"<|user|>\n{x.content}\n"
|
| 55 |
return "" if len(t) == 0 else t
|
| 56 |
|