Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -44,16 +44,16 @@ with gr.Blocks(css = "custom.css") as demo:
|
|
44 |
def bot_api(user_message):
|
45 |
l = user_message.split("[SEP]")
|
46 |
history = []
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
else:
|
53 |
-
if len(history[-1]) == 2:
|
54 |
-
history.append([ele])
|
55 |
else:
|
56 |
-
history[-1]
|
|
|
|
|
|
|
57 |
if len(history[-1]) <= 1:
|
58 |
return ""
|
59 |
history[-1][1] = ""
|
|
|
44 |
def bot_api(user_message):
|
45 |
l = user_message.split("[SEP]")
|
46 |
history = []
|
47 |
+
for ele in l:
|
48 |
+
if not history:
|
49 |
+
history.append(
|
50 |
+
[ele]
|
51 |
+
)
|
|
|
|
|
|
|
52 |
else:
|
53 |
+
if len(history[-1]) == 2:
|
54 |
+
history.append([ele])
|
55 |
+
else:
|
56 |
+
history[-1].append(ele)
|
57 |
if len(history[-1]) <= 1:
|
58 |
return ""
|
59 |
history[-1][1] = ""
|