Spaces:
Sleeping
Sleeping
History error fix
Browse files
app.py
CHANGED
@@ -16,6 +16,10 @@ def respond(
|
|
16 |
temperature,
|
17 |
top_p,
|
18 |
):
|
|
|
|
|
|
|
|
|
19 |
try:
|
20 |
# Format the chat history for the DialoGPT model using the 'messages' format
|
21 |
conversation = [{"role": "system", "content": system_message}]
|
|
|
16 |
temperature,
|
17 |
top_p,
|
18 |
):
|
19 |
+
# Initialize history if it is None
|
20 |
+
if history is None:
|
21 |
+
history = []
|
22 |
+
|
23 |
try:
|
24 |
# Format the chat history for the DialoGPT model using the 'messages' format
|
25 |
conversation = [{"role": "system", "content": system_message}]
|