Update app.py
Browse files
app.py
CHANGED
@@ -28,14 +28,14 @@ def converse(user_input, chat_history=[]):
|
|
28 |
print(response)
|
29 |
|
30 |
# write some HTML
|
31 |
-
html = "<div class='
|
32 |
-
for
|
33 |
-
cls = "user" if
|
34 |
-
print("value of
|
35 |
-
print(
|
36 |
print("message")
|
37 |
-
print (
|
38 |
-
html += "<div class='
|
39 |
html += "</div>"
|
40 |
print(html)
|
41 |
return html, chat_history
|
@@ -44,9 +44,9 @@ import gradio as grad
|
|
44 |
|
45 |
css = """
|
46 |
.chatbox {display:flex;flex-direction:column}
|
47 |
-
.
|
48 |
-
.
|
49 |
-
.
|
50 |
.footer {display:none !important}
|
51 |
"""
|
52 |
text=grad.inputs.Textbox(placeholder="Lets chat")
|
|
|
28 |
print(response)
|
29 |
|
30 |
# write some HTML
|
31 |
+
html = "<div class='mybot'>"
|
32 |
+
for x, mesg in enumerate(response):
|
33 |
+
cls = "user" if x%2 == 0 else "bot"
|
34 |
+
print("value of x")
|
35 |
+
print(x)
|
36 |
print("message")
|
37 |
+
print (mesg)
|
38 |
+
html += "<div class='mesg {}'> {}</div>".format(cls, msg)
|
39 |
html += "</div>"
|
40 |
print(html)
|
41 |
return html, chat_history
|
|
|
44 |
|
45 |
css = """
|
46 |
.chatbox {display:flex;flex-direction:column}
|
47 |
+
.mesg {padding:5px;margin-bottom:5px;border-radius:5px;width:75%}
|
48 |
+
.mesg.user {background-color:lightblue;color:white}
|
49 |
+
.mesg.bot {background-color:orange;color:white,align-self:self-end}
|
50 |
.footer {display:none !important}
|
51 |
"""
|
52 |
text=grad.inputs.Textbox(placeholder="Lets chat")
|