Spaces:
Sleeping
Sleeping
with gr.Blocks() as demo:
Browse files
app.py
CHANGED
@@ -64,27 +64,18 @@ with gr.Blocks() as demo:
|
|
64 |
with gr.Row():
|
65 |
with gr.Column():
|
66 |
file_upload = gr.File(label="Upload your file")
|
67 |
-
|
68 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
|
70 |
-
with gr.Row():
|
71 |
-
chatbot = gr.Chatbot()
|
72 |
-
|
73 |
-
with gr.Row():
|
74 |
with gr.Column():
|
75 |
-
|
76 |
-
# password_input = gr.Textbox(label="Password", type="password")
|
77 |
-
msg = gr.Textbox(label="請输入對話內容")
|
78 |
-
send_button = gr.Button("發送")
|
79 |
|
80 |
-
# 当文件上传时,更新 DataFrame 字符串
|
81 |
file_upload.change(process_file, inputs=file_upload, outputs=df_string_output)
|
82 |
|
83 |
-
# 处理聊天机器人的对话
|
84 |
-
send_button.click(
|
85 |
-
respond,
|
86 |
-
inputs=[msg, df_string_output, chatbot],
|
87 |
-
outputs=[msg, chatbot]
|
88 |
-
)
|
89 |
-
|
90 |
demo.launch()
|
|
|
64 |
with gr.Row():
|
65 |
with gr.Column():
|
66 |
file_upload = gr.File(label="Upload your file")
|
67 |
+
chatbot = gr.Chatbot()
|
68 |
+
msg = gr.Textbox(label="请输入对话内容")
|
69 |
+
send_button = gr.Button("发送")
|
70 |
+
send_button.click(
|
71 |
+
respond,
|
72 |
+
inputs=[msg, file_upload, chatbot],
|
73 |
+
outputs=[msg, chatbot]
|
74 |
+
)
|
75 |
|
|
|
|
|
|
|
|
|
76 |
with gr.Column():
|
77 |
+
df_string_output = gr.Textbox(label="raw data", interactive=False)
|
|
|
|
|
|
|
78 |
|
|
|
79 |
file_upload.change(process_file, inputs=file_upload, outputs=df_string_output)
|
80 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
demo.launch()
|