Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -299,10 +299,9 @@ with gr.Blocks(
|
|
| 299 |
# 用户状态(登录)
|
| 300 |
user_name_state = gr.State("")
|
| 301 |
user_id_state = gr.State("")
|
| 302 |
-
|
| 303 |
# --- Header ---
|
| 304 |
with gr.Row(elem_classes="header-container"):
|
| 305 |
-
with gr.Column(scale=
|
| 306 |
gr.HTML(
|
| 307 |
f"""
|
| 308 |
<div style="display:flex; align-items:center; gap: 20px;">
|
|
@@ -320,15 +319,6 @@ with gr.Blocks(
|
|
| 320 |
"""
|
| 321 |
)
|
| 322 |
|
| 323 |
-
with gr.Column(scale=1):
|
| 324 |
-
gr.HTML(
|
| 325 |
-
f"""
|
| 326 |
-
<div style="display:flex; justify-content:flex-end; margin-bottom: 5px;">
|
| 327 |
-
<img src="{image_to_base64(HANBRIDGE_LOGO_PATH)}" style="height: 55px; object-fit: contain;">
|
| 328 |
-
</div>
|
| 329 |
-
"""
|
| 330 |
-
)
|
| 331 |
-
|
| 332 |
# --- Main Layout ---
|
| 333 |
with gr.Row():
|
| 334 |
|
|
@@ -435,7 +425,34 @@ with gr.Blocks(
|
|
| 435 |
# === Center Main ===
|
| 436 |
with gr.Column(scale=3):
|
| 437 |
|
| 438 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 439 |
with gr.Row():
|
| 440 |
with gr.Column(scale=2):
|
| 441 |
syllabus_file = gr.File(
|
|
@@ -480,6 +497,8 @@ with gr.Blocks(
|
|
| 480 |
)
|
| 481 |
session_status = gr.Markdown(visible=False)
|
| 482 |
|
|
|
|
|
|
|
| 483 |
# Chat instruction(主聊天框上方提示 Module10 已预加载)
|
| 484 |
gr.Markdown(
|
| 485 |
"""
|
|
|
|
| 299 |
# 用户状态(登录)
|
| 300 |
user_name_state = gr.State("")
|
| 301 |
user_id_state = gr.State("")
|
|
|
|
| 302 |
# --- Header ---
|
| 303 |
with gr.Row(elem_classes="header-container"):
|
| 304 |
+
with gr.Column(scale=3):
|
| 305 |
gr.HTML(
|
| 306 |
f"""
|
| 307 |
<div style="display:flex; align-items:center; gap: 20px;">
|
|
|
|
| 319 |
"""
|
| 320 |
)
|
| 321 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 322 |
# --- Main Layout ---
|
| 323 |
with gr.Row():
|
| 324 |
|
|
|
|
| 425 |
# === Center Main ===
|
| 426 |
with gr.Column(scale=3):
|
| 427 |
|
| 428 |
+
# 1) Instruction + Chat
|
| 429 |
+
gr.Markdown(
|
| 430 |
+
"""
|
| 431 |
+
<div style="background-color:#f9fafb; padding:10px; border-radius:5px; margin-top:10px; font-size:0.9em; color:#555;">
|
| 432 |
+
✦ <b>Instruction:</b> This prototype is <b>pre-loaded</b> with <b>Module 10 – Responsible AI (Alto, 2024, Chapter 12)</b>.<br>
|
| 433 |
+
✦ You do <b>not</b> need to upload files (uploads are optional).<br>
|
| 434 |
+
✦ Please log in on the right before chatting with Clare.
|
| 435 |
+
</div>
|
| 436 |
+
"""
|
| 437 |
+
)
|
| 438 |
+
|
| 439 |
+
chatbot = gr.Chatbot(
|
| 440 |
+
label="",
|
| 441 |
+
height=450,
|
| 442 |
+
avatar_images=(None, CLARE_LOGO_PATH),
|
| 443 |
+
show_label=False,
|
| 444 |
+
bubble_full_width=False,
|
| 445 |
+
)
|
| 446 |
+
user_input = gr.Textbox(
|
| 447 |
+
label="Your Input",
|
| 448 |
+
placeholder="Please log in on the right before asking Clare anything...",
|
| 449 |
+
show_label=False,
|
| 450 |
+
container=True,
|
| 451 |
+
autofocus=False,
|
| 452 |
+
interactive=False,
|
| 453 |
+
)
|
| 454 |
+
|
| 455 |
+
# 2) Upload / File type / Memory Line(从原来的 Top Control Row 拿下来放在 chat 下面)
|
| 456 |
with gr.Row():
|
| 457 |
with gr.Column(scale=2):
|
| 458 |
syllabus_file = gr.File(
|
|
|
|
| 497 |
)
|
| 498 |
session_status = gr.Markdown(visible=False)
|
| 499 |
|
| 500 |
+
|
| 501 |
+
|
| 502 |
# Chat instruction(主聊天框上方提示 Module10 已预加载)
|
| 503 |
gr.Markdown(
|
| 504 |
"""
|