prakhardoneria commited on
Commit
8a0b89f
·
verified ·
1 Parent(s): ad84c7e

History error fix

Browse files
Files changed (1) hide show
  1. app.py +4 -0
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}]