wangrongsheng commited on
Commit
0f6900b
1 Parent(s): 6e2593d

Update optimizeOpenAI.py

Browse files
Files changed (1) hide show
  1. optimizeOpenAI.py +2 -1
optimizeOpenAI.py CHANGED
@@ -94,7 +94,8 @@ class chatPaper:
94
  while True:
95
  full_conversation = ""
96
  for x in self.conversation[convo_id]:
97
- full_conversation = str(x["content"] + "\n")
 
98
  if (len(ENCODER.encode(full_conversation)) > self.max_tokens):
99
  self.conversation[convo_id][-1] = self.conversation[convo_id][-1][:-self.decrease_step]
100
  else:
 
94
  while True:
95
  full_conversation = ""
96
  for x in self.conversation[convo_id]:
97
+ #full_conversation = str(x["content"] + "\n")
98
+ full_conversation = "{} \n".format(x["content"])
99
  if (len(ENCODER.encode(full_conversation)) > self.max_tokens):
100
  self.conversation[convo_id][-1] = self.conversation[convo_id][-1][:-self.decrease_step]
101
  else: