ambrosfitz commited on
Commit
dabe6f0
·
verified ·
1 Parent(s): 03e0ef4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -9,7 +9,10 @@ client = OpenAI(
9
  base_url="https://api.runpod.ai/v2/vllm-k0g4c60zor9xuu/openai/v1",
10
  )
11
 
12
- def predict(message, history=[]):
 
 
 
13
  # Append the system role at the start if history is empty
14
  if not history:
15
  history.append(("system", "You are a history assistant, that provides the best possible answers to any historical questions asked about American History. Be helpful and specific, providing any detailed nuance needed to have a full understanding of the question."))
 
9
  base_url="https://api.runpod.ai/v2/vllm-k0g4c60zor9xuu/openai/v1",
10
  )
11
 
12
+ def predict(message, history=None):
13
+ # Ensure history is initialized as an empty list if it's None
14
+ if history is None:
15
+ history = []
16
  # Append the system role at the start if history is empty
17
  if not history:
18
  history.append(("system", "You are a history assistant, that provides the best possible answers to any historical questions asked about American History. Be helpful and specific, providing any detailed nuance needed to have a full understanding of the question."))