Spaces:
Runtime error
Runtime error
ryanrwatkins
commited on
Commit
Β·
eb37076
1
Parent(s):
674a361
Update app.py
Browse files
app.py
CHANGED
@@ -184,8 +184,11 @@ def submit_message(prompt, prompt_template, temperature, max_tokens, context_len
|
|
184 |
state['total_tokens'] += completion['usage']['total_tokens']
|
185 |
|
186 |
except Exception as e:
|
187 |
-
history.append(prompt_msg)
|
188 |
-
history.append(
|
|
|
|
|
|
|
189 |
|
190 |
total_tokens_used_msg = f"Total tokens used: {state['total_tokens']}"
|
191 |
|
|
|
184 |
state['total_tokens'] += completion['usage']['total_tokens']
|
185 |
|
186 |
except Exception as e:
|
187 |
+
history.append(prompt_msg.copy())
|
188 |
+
history.append({
|
189 |
+
"role": "system",
|
190 |
+
"content": f"Error: {e}"
|
191 |
+
}.copy())
|
192 |
|
193 |
total_tokens_used_msg = f"Total tokens used: {state['total_tokens']}"
|
194 |
|