Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 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)
|