update css styling for chatbot

#1
by ysharma HF staff - opened
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -32,12 +32,13 @@ def chat(user_input):
32
  response += word + " "
33
  yield [(user_input, response)]
34
 
35
- with gr.Blocks() as demo:
 
36
  gr.Markdown(f"## {TITLE}\n\n\n\n{ABSTRACT}")
 
 
 
37
 
38
- chatbot = gr.Chatbot()
39
- textbox = gr.Textbox(placeholder="Enter a prompt")
40
-
41
- textbox.submit(chat, textbox, chatbot)
42
 
43
  demo.queue(api_open=False).launch()
 
32
  response += word + " "
33
  yield [(user_input, response)]
34
 
35
+ with gr.Blocks(css = """#col_container {width: 700px; margin-left: auto; margin-right: auto;}
36
+ #chatbot {height: 400px; overflow: auto;}""") as demo:
37
  gr.Markdown(f"## {TITLE}\n\n\n\n{ABSTRACT}")
38
+ with gr.Column(elem_id='col_container'):
39
+ chatbot = gr.Chatbot(elem_id='chatbot')
40
+ textbox = gr.Textbox(placeholder="Enter a prompt")
41
 
42
+ textbox.submit(chat, textbox, chatbot)
 
 
 
43
 
44
  demo.queue(api_open=False).launch()