Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -115,42 +115,42 @@ topics = """
|
|
115 |
"""
|
116 |
|
117 |
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
)
|
140 |
|
141 |
-
#
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
|
155 |
|
156 |
Launch the Gradio app to allow user interaction
|
|
|
115 |
"""
|
116 |
|
117 |
|
118 |
+
Display function
|
119 |
+
|
120 |
+
def display_image():
|
121 |
+
return "https://files.slack.com/files-tmb/T06QHKW6JFM-F077K96ABN3-2364e0b7a9/img_1576_720.jpg"
|
122 |
+
|
123 |
+
with gr.Blocks(theme=theme) as demo:
|
124 |
+
theme = gr.themes.Monochrome(
|
125 |
+
primary_hue="amber",
|
126 |
+
secondary_hue="rose",
|
127 |
+
).set(
|
128 |
+
background_fill_primary='*primary_200',
|
129 |
+
background_fill_primary_dark='*primary_200',
|
130 |
+
background_fill_secondary='*secondary_300',
|
131 |
+
background_fill_secondary_dark='*secondary_300',
|
132 |
+
border_color_accent='*secondary_200',
|
133 |
+
border_color_accent_dark='*secondary_600',
|
134 |
+
border_color_accent_subdued='*secondary_200',
|
135 |
+
border_color_primary='*secondary_300',
|
136 |
+
block_border_color='*secondary_200',
|
137 |
+
button_primary_background_fill='*secondary_300',
|
138 |
+
button_primary_background_fill_dark='*secondary_300'
|
139 |
)
|
140 |
|
141 |
+
# Setup the Gradio Blocks interface with custom layout components
|
142 |
+
with gr.Blocks(theme=theme) as demo:
|
143 |
+
gr.image(display_image(scale=1, min_width=200))
|
144 |
+
gr.Markdown(welcome_message) # Display the formatted welcome message
|
145 |
+
with gr.Row():
|
146 |
+
with gr.Column():
|
147 |
+
gr.Markdown(topics) # Show the topics on the left side
|
148 |
+
with gr.Row():
|
149 |
+
with gr.Column():
|
150 |
+
question = gr.Textbox(label="Your question", placeholder="What do you want to ask about?")
|
151 |
+
answer = gr.Textbox(label="GloBot Response", placeholder="GloBot will respond here...", interactive=False, lines=10)
|
152 |
+
submit_button = gr.Button("Submit")
|
153 |
+
submit_button.click(fn=query_model, inputs=question, outputs=answer)
|
154 |
|
155 |
|
156 |
Launch the Gradio app to allow user interaction
|