Update app.py
Browse files
app.py
CHANGED
@@ -189,29 +189,40 @@ assistant_logo = os.getenv('LOGO')
|
|
189 |
with gr.Blocks(theme=isp_theme, css=custom_css) as iface:
|
190 |
with gr.Column(elem_classes="container"):
|
191 |
with gr.Row():
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
|
|
|
|
|
|
197 |
gr.Markdown(f"# {assistant_title}", elem_classes="title")
|
198 |
-
|
199 |
gr.Markdown("Chat with a Historical Figure")
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
209 |
with gr.Row(elem_classes="button-row"):
|
210 |
submit = gr.Button("Submit", variant="primary")
|
211 |
clear = gr.ClearButton([msg, chatbot], value="Clear", variant="secondary")
|
212 |
undo = gr.Button("Delete Previous", variant="secondary")
|
213 |
-
|
214 |
-
gr.HTML(
|
|
|
|
|
215 |
|
216 |
def user(user_message, history):
|
217 |
return "", history + [[user_message, None]]
|
|
|
189 |
with gr.Blocks(theme=isp_theme, css=custom_css) as iface:
|
190 |
with gr.Column(elem_classes="container"):
|
191 |
with gr.Row():
|
192 |
+
# Logo and Title
|
193 |
+
gr.HTML(
|
194 |
+
f"""
|
195 |
+
<img id='logo-img' src='{assistant_logo}' alt='Assistant Logo' onerror="this.style.display='none';document.getElementById('logo-error').style.display='block';">
|
196 |
+
<div id='logo-error' style='display:none;'>Logo not found</div>
|
197 |
+
""",
|
198 |
+
elem_id='logo-container'
|
199 |
+
)
|
200 |
gr.Markdown(f"# {assistant_title}", elem_classes="title")
|
201 |
+
|
202 |
gr.Markdown("Chat with a Historical Figure")
|
203 |
+
|
204 |
+
# Chatbot and message input
|
205 |
+
with gr.Row():
|
206 |
+
with gr.Column(scale=6):
|
207 |
+
chatbot = gr.Chatbot(
|
208 |
+
height=500,
|
209 |
+
avatar_images=(None, assistant_avatar),
|
210 |
+
elem_classes="chatbot"
|
211 |
+
)
|
212 |
+
with gr.Column(scale=1):
|
213 |
+
msg = gr.Textbox(
|
214 |
+
placeholder="Type your message here...",
|
215 |
+
container=False
|
216 |
+
)
|
217 |
+
|
218 |
with gr.Row(elem_classes="button-row"):
|
219 |
submit = gr.Button("Submit", variant="primary")
|
220 |
clear = gr.ClearButton([msg, chatbot], value="Clear", variant="secondary")
|
221 |
undo = gr.Button("Delete Previous", variant="secondary")
|
222 |
+
|
223 |
+
gr.HTML(
|
224 |
+
"<div id='disclaimer-footer'>You are chatting with an AI assistant. Make sure to evaluate the accuracy of its answers.</div>"
|
225 |
+
)
|
226 |
|
227 |
def user(user_message, history):
|
228 |
return "", history + [[user_message, None]]
|