zhangjf commited on
Commit
9031adc
1 Parent(s): 46d51d2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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:]