Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -12,7 +12,7 @@ client = OpenAI(
|
|
12 |
def runpod_chat(question, history=None):
|
13 |
# Explicitly initialize history if it's None
|
14 |
if history is None:
|
15 |
-
history = []
|
16 |
history.append({"role": "user", "content": question})
|
17 |
|
18 |
response_stream = client.chat.completions.create(
|
@@ -38,7 +38,7 @@ iface = gr.Interface(
|
|
38 |
fn=runpod_chat,
|
39 |
inputs=[
|
40 |
gr.Textbox(label="Enter your question:"),
|
41 |
-
gr.State(
|
42 |
],
|
43 |
outputs=[
|
44 |
gr.Textbox(label="Responses"),
|
|
|
12 |
def runpod_chat(question, history=None):
|
13 |
# Explicitly initialize history if it's None
|
14 |
if history is None:
|
15 |
+
history = [] # Ensure history starts as an empty list if none is provided
|
16 |
history.append({"role": "user", "content": question})
|
17 |
|
18 |
response_stream = client.chat.completions.create(
|
|
|
38 |
fn=runpod_chat,
|
39 |
inputs=[
|
40 |
gr.Textbox(label="Enter your question:"),
|
41 |
+
gr.State() # Remove default parameter
|
42 |
],
|
43 |
outputs=[
|
44 |
gr.Textbox(label="Responses"),
|