Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -64,7 +64,7 @@ See https://github.com/openai/openai-python/blob/main/chatml.md for information
|
|
64 |
|
65 |
def forget_long_term(messages, max_num_tokens=1000):
|
66 |
while num_tokens_from_messages(messages)>max_num_tokens:
|
67 |
-
if messages[0]["role"]=="system" and not len(messages[0]["content"]>=max_num_tokens
|
68 |
messages = messages[:1] + messages[2:]
|
69 |
else:
|
70 |
messages = messages[1:]
|
|
|
64 |
|
65 |
def forget_long_term(messages, max_num_tokens=1000):
|
66 |
while num_tokens_from_messages(messages)>max_num_tokens:
|
67 |
+
if messages[0]["role"]=="system" and not len(messages[0]["content"])>=max_num_tokens:
|
68 |
messages = messages[:1] + messages[2:]
|
69 |
else:
|
70 |
messages = messages[1:]
|