allyyy commited on
Commit
de01f12
·
verified ·
1 Parent(s): 1d1a282

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -16
app.py CHANGED
@@ -132,23 +132,21 @@ theme = gr.themes.Default(
132
 
133
  # Setup the Gradio Blocks interface with custom layout components
134
  with gr.Blocks(theme=theme) as demo:
135
-
136
- gr.Markdown(welcome_message) # Display the formatted welcome message
137
 
138
- with gr.Row():
139
- with gr.Column(scale=0.8):
140
- gr.Markdown(topics)
141
-
142
-
143
- # Show the topics on the left side
144
- with gr.Row():
145
- with gr.Column():
146
- question = gr.Textbox(label="You", placeholder="What do you want to talk to CalmBot about?")
147
- answer = gr.Textbox(label="CalmBot's Response :D", placeholder="CalmBot will respond here..", interactive=False, lines=20)
148
- submit_button = gr.Button("Submit")
149
- submit_button.click(fn=query_model, inputs=question, outputs=answer)
150
-
151
- demo.launch()
152
 
153
  # Launch the Gradio app to allow user interaction
154
  demo.launch(share=True)
 
132
 
133
  # Setup the Gradio Blocks interface with custom layout components
134
  with gr.Blocks(theme=theme) as demo:
 
 
135
 
136
+ # Centering the content using Gradio Rows and Columns
137
+ with gr.Row(align="center", elem_id="main-row", equal_height=True):
138
+ with gr.Column(scale=1, min_width=300):
139
+ gr.Markdown(welcome_message)
140
+ with gr.Row():
141
+ with gr.Column(scale=0.8):
142
+ gr.Markdown(topics)
143
+
144
+ with gr.Row(align="center"):
145
+ with gr.Column(scale=1, min_width=300):
146
+ question = gr.Textbox(label="You", placeholder="What do you want to talk to CalmBot about?", lines=2)
147
+ answer = gr.Textbox(label="CalmBot's Response :D", placeholder="CalmBot will respond here..", interactive=False, lines=20)
148
+ submit_button = gr.Button("Submit")
149
+ submit_button.click(fn=query_model, inputs=question, outputs=answer)
150
 
151
  # Launch the Gradio app to allow user interaction
152
  demo.launch(share=True)