Spaces:
Running
Running
Update app.py
Browse files
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,
|