reedmayhew commited on
Commit
e9541b9
·
verified ·
1 Parent(s): 272db28

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -152,6 +152,8 @@ def chat_with_openai(message: str, history: list, temperature: float, max_new_to
152
  response = None
153
 
154
  while attempt < 5:
 
 
155
  attempt += 1
156
  response = client.chat.completions.create(
157
  model=ai_model,
 
152
  response = None
153
 
154
  while attempt < 5:
155
+ if attempt == 4:
156
+ del conversation[-1]
157
  attempt += 1
158
  response = client.chat.completions.create(
159
  model=ai_model,