smjain commited on
Commit
649ab52
·
1 Parent(s): 1dd7bc4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -10
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='chatbot'>"
32
- for m, msg in enumerate(response):
33
- cls = "user" if m%2 == 0 else "bot"
34
- print("value of m")
35
- print(m)
36
  print("message")
37
- print (msg)
38
- html += "<div class='msg {}'> {}</div>".format(cls, msg)
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
- .msg {padding:5px;margin-bottom:5px;border-radius:5px;width:75%}
48
- .msg.user {background-color:lightblue;color:white}
49
- .msg.bot {background-color:orange;color:white,align-self:self-end}
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")