Spaces:
Build error
Build error
ss
Browse files
app.py
CHANGED
@@ -47,15 +47,19 @@ def predict(inputs, chatbot):
|
|
47 |
|
48 |
print(f'inputs is - {inputs}')
|
49 |
print(f'chatbot is - {chatbot}')
|
50 |
-
if chatbot[0][-1] is None: #[["hi there'", None]]
|
51 |
-
|
52 |
messages = []
|
53 |
for conv in chatbot:
|
54 |
user = conv[0]
|
55 |
-
assistant = conv[1]
|
56 |
messages.append({"role": "user", "content":user })
|
|
|
|
|
|
|
|
|
57 |
messages.append({"role": "assistant", "content":assistant})
|
58 |
-
|
|
|
59 |
print(f'messages is - {messages}')
|
60 |
|
61 |
# a ChatCompletion request
|
|
|
47 |
|
48 |
print(f'inputs is - {inputs}')
|
49 |
print(f'chatbot is - {chatbot}')
|
50 |
+
#if chatbot[0][-1] is None: #[["hi there'", None]]
|
51 |
+
# chatbot=[]
|
52 |
messages = []
|
53 |
for conv in chatbot:
|
54 |
user = conv[0]
|
|
|
55 |
messages.append({"role": "user", "content":user })
|
56 |
+
if chatbot[0][-1] is None: #[["hi there'", None]]
|
57 |
+
#chatbot=[]
|
58 |
+
break
|
59 |
+
assistant = conv[1]
|
60 |
messages.append({"role": "assistant", "content":assistant})
|
61 |
+
|
62 |
+
#messages.append({"role": "user", "content":inputs})
|
63 |
print(f'messages is - {messages}')
|
64 |
|
65 |
# a ChatCompletion request
|