Spaces:
Sleeping
Sleeping
shandong1970
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -32,20 +32,21 @@ def converse(user_input, chat_history=[]):
|
|
32 |
print(mesg)
|
33 |
|
34 |
html += "<div class='mesg {}'> {}</div>".format(clazz,mesg)
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
|
|
51 |
|
|
|
32 |
print(mesg)
|
33 |
|
34 |
html += "<div class='mesg {}'> {}</div>".format(clazz,mesg)
|
35 |
+
|
36 |
+
html += "</div>"
|
37 |
+
print(html)
|
38 |
+
return html, chat_history
|
39 |
+
|
40 |
+
import gradio as grad
|
41 |
+
|
42 |
+
css ="""
|
43 |
+
.mychat {display:flex;flex-direction:column}
|
44 |
+
.mesg {padding:5px;margin-bottom:5px;border-radius:5px;width:75%}
|
45 |
+
.mesg.user {background-color:lightblue;color:white}
|
46 |
+
.mesg.alicia {background-color:orange;color:white,align-self:self-end}
|
47 |
+
.footer {display:none !important}
|
48 |
+
"""
|
49 |
+
|
50 |
+
text = grad.inputs.Textbox(placeholder="Lets chat")
|
51 |
+
grad.Interface(fn=converse, theme="default",inputs=[text,"state"],outputs=["html","state"],css=css).launch()
|
52 |
|