Spaces:
Running
Running
Tafazzul-Nadeeem
commited on
Commit
·
4b939e8
1
Parent(s):
0a65cbe
image upload bug fixed
Browse files
app.py
CHANGED
|
@@ -39,7 +39,7 @@ with gr.Blocks() as demo:
|
|
| 39 |
def respond(history):
|
| 40 |
print("history", history)
|
| 41 |
if len(history) == 1:
|
| 42 |
-
history.insert(0,{"role": "system",
|
| 43 |
# print("history after insert", history)
|
| 44 |
messages = copy.deepcopy(history)
|
| 45 |
for i, msg in enumerate(messages):
|
|
@@ -74,7 +74,7 @@ with gr.Blocks() as demo:
|
|
| 74 |
response = response.choices[0].message.content.strip()
|
| 75 |
# print("response:", response)
|
| 76 |
# history.append({"role": "assistant", "content": response})
|
| 77 |
-
history.append({"role": "assistant",
|
| 78 |
|
| 79 |
# return history
|
| 80 |
print("history", history)
|
|
|
|
| 39 |
def respond(history):
|
| 40 |
print("history", history)
|
| 41 |
if len(history) == 1:
|
| 42 |
+
history.insert(0,{"role": "system", "content": "You are a helpful assistant."})
|
| 43 |
# print("history after insert", history)
|
| 44 |
messages = copy.deepcopy(history)
|
| 45 |
for i, msg in enumerate(messages):
|
|
|
|
| 74 |
response = response.choices[0].message.content.strip()
|
| 75 |
# print("response:", response)
|
| 76 |
# history.append({"role": "assistant", "content": response})
|
| 77 |
+
history.append({"role": "assistant", "content": ""})
|
| 78 |
|
| 79 |
# return history
|
| 80 |
print("history", history)
|