Spaces:
Sleeping
Sleeping
Fishead_East
commited on
Commit
•
0393628
1
Parent(s):
fd36454
功能阉割,只留核心交互模块
Browse files- app.py +11 -11
- gradio_ui/gr_chat.py +4 -4
app.py
CHANGED
@@ -18,17 +18,17 @@ with gr.Blocks() as demo:
|
|
18 |
with gr.Tab(label="儿童模式", id="child") as ChildTab:
|
19 |
chat_poetry(ChildTab)
|
20 |
|
21 |
-
# 文生图
|
22 |
-
with gr.Column(scale=3):
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
image_button.click(None, inputs=txt_img, outputs=image_out) # todo 生图函数待填充
|
32 |
|
33 |
|
34 |
demo.queue()
|
|
|
18 |
with gr.Tab(label="儿童模式", id="child") as ChildTab:
|
19 |
chat_poetry(ChildTab)
|
20 |
|
21 |
+
# # 文生图
|
22 |
+
# with gr.Column(scale=3):
|
23 |
+
# gr.Markdown("## 文生图")
|
24 |
+
# image_out = gr.Image(shape=(200, 200))
|
25 |
+
# txt_img = gr.Textbox(
|
26 |
+
# show_label=False,
|
27 |
+
# placeholder="Enter text and press enter",
|
28 |
+
# ).style(container=False)
|
29 |
+
#
|
30 |
+
# image_button = gr.Button("点击生图")
|
31 |
+
# image_button.click(None, inputs=txt_img, outputs=image_out) # todo 生图函数待填充
|
32 |
|
33 |
|
34 |
demo.queue()
|
gradio_ui/gr_chat.py
CHANGED
@@ -16,10 +16,10 @@ def chat_poetry(tab: gr.Tab):
|
|
16 |
pattern = gr.Markdown(f"{tab.id}")
|
17 |
action = gr.State(value=False) # 指示有效对话是否开始(开始时用户未提及古诗诗人则未进入)
|
18 |
with gr.Row():
|
19 |
-
# todo 历史记录
|
20 |
-
with gr.Column(scale=2):
|
21 |
-
|
22 |
-
|
23 |
# 交互界面
|
24 |
with gr.Column(scale=8):
|
25 |
gr.Markdown("## 交互界面")
|
|
|
16 |
pattern = gr.Markdown(f"{tab.id}")
|
17 |
action = gr.State(value=False) # 指示有效对话是否开始(开始时用户未提及古诗诗人则未进入)
|
18 |
with gr.Row():
|
19 |
+
# # todo 历史记录
|
20 |
+
# with gr.Column(scale=2):
|
21 |
+
# gr.Markdown("## 历史记录")
|
22 |
+
chat_history = gr.State([[]]) # 存储单次聊天记录的组件
|
23 |
# 交互界面
|
24 |
with gr.Column(scale=8):
|
25 |
gr.Markdown("## 交互界面")
|