Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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."))
|