Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -567,21 +567,19 @@ def medical_chat(user_input, history):
|
|
567 |
|
568 |
# 构建 Gradio 界面
|
569 |
with gr.Blocks(theme=gr.themes.Soft(), css="""
|
570 |
-
.container {display: flex; flex-direction: row;
|
571 |
-
.
|
572 |
-
.
|
573 |
-
.
|
574 |
-
.chat-window {height: 450px !important; overflow-y: auto;}
|
575 |
-
.title-text {margin-bottom: 5px;}
|
576 |
""") as demo:
|
577 |
-
gr.Markdown("# 🏥 专业医疗咨询助手"
|
578 |
-
gr.Markdown("### 本系统提供基于AI的医疗咨询服务,仅供参考,不能替代专业医生的诊断"
|
579 |
|
580 |
-
#
|
581 |
-
with gr.Row(
|
582 |
# 左侧列 - 主聊天界面
|
583 |
-
with gr.Column(
|
584 |
-
gr.Markdown("### 请描述您的症状或健康问题"
|
585 |
chat_interface = gr.ChatInterface(
|
586 |
fn=medical_chat,
|
587 |
examples=[
|
@@ -590,12 +588,11 @@ with gr.Blocks(theme=gr.themes.Soft(), css="""
|
|
590 |
"孩子有轻微发烧,需要去医院吗?"
|
591 |
],
|
592 |
title="症状咨询",
|
593 |
-
chatbot=gr.Chatbot(
|
594 |
-
elem_classes=["chat-interface"]
|
595 |
)
|
596 |
|
597 |
# 右侧列 - 辅助信息
|
598 |
-
with gr.Column(
|
599 |
# 添加医疗免责声明
|
600 |
with gr.Accordion("医疗免责声明", open=True):
|
601 |
gr.Markdown("""
|
|
|
567 |
|
568 |
# 构建 Gradio 界面
|
569 |
with gr.Blocks(theme=gr.themes.Soft(), css="""
|
570 |
+
.container { display: flex; flex-direction: row; }
|
571 |
+
.left-column { flex: 3; }
|
572 |
+
.right-column { flex: 1; }
|
573 |
+
.chatbot-container { height: 450px; }
|
|
|
|
|
574 |
""") as demo:
|
575 |
+
gr.Markdown("# 🏥 专业医疗咨询助手")
|
576 |
+
gr.Markdown("### 本系统提供基于AI的医疗咨询服务,仅供参考,不能替代专业医生的诊断")
|
577 |
|
578 |
+
# 创建两列布局
|
579 |
+
with gr.Row(elem_id="container", equal_height=True):
|
580 |
# 左侧列 - 主聊天界面
|
581 |
+
with gr.Column(scale=3, elem_id="left-column"):
|
582 |
+
gr.Markdown("### 请描述您的症状或健康问题")
|
583 |
chat_interface = gr.ChatInterface(
|
584 |
fn=medical_chat,
|
585 |
examples=[
|
|
|
588 |
"孩子有轻微发烧,需要去医院吗?"
|
589 |
],
|
590 |
title="症状咨询",
|
591 |
+
chatbot=gr.Chatbot(height=450)
|
|
|
592 |
)
|
593 |
|
594 |
# 右侧列 - 辅助信息
|
595 |
+
with gr.Column(scale=1, elem_id="right-column"):
|
596 |
# 添加医疗免责声明
|
597 |
with gr.Accordion("医疗免责声明", open=True):
|
598 |
gr.Markdown("""
|