Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -369,7 +369,7 @@ with gr.Blocks(title="Com.404 公司去那兒?", theme=gr.themes.Soft()) as de
|
|
| 369 |
# Chat Section
|
| 370 |
with gr.Column(elem_classes="chat-section"):
|
| 371 |
gr.Markdown("### 🤖 商業顧問 (已閱讀下方報告)")
|
| 372 |
-
#
|
| 373 |
chatbot = gr.Chatbot(height=250)
|
| 374 |
with gr.Row():
|
| 375 |
msg = gr.Textbox(label="提問", placeholder="例如:這間公司適合新鮮人嗎?有勞資糾紛嗎?", scale=4)
|
|
@@ -398,8 +398,9 @@ with gr.Blocks(title="Com.404 公司去那兒?", theme=gr.themes.Soft()) as de
|
|
| 398 |
|
| 399 |
demo.load(init_on_load, inputs=None, outputs=[saved_state, comp_df])
|
| 400 |
|
|
|
|
| 401 |
search_btn.click(
|
| 402 |
-
|
| 403 |
inputs=[search_input, saved_state],
|
| 404 |
outputs=[comp_df, search_res_state, load_more_btn]
|
| 405 |
).then(
|
|
@@ -418,8 +419,9 @@ with gr.Blocks(title="Com.404 公司去那兒?", theme=gr.themes.Soft()) as de
|
|
| 418 |
outputs=[comp_df, load_more_btn]
|
| 419 |
)
|
| 420 |
|
|
|
|
| 421 |
comp_df.select(
|
| 422 |
-
|
| 423 |
inputs=[search_res_state, saved_state, view_radio],
|
| 424 |
outputs=[
|
| 425 |
details_col, detail_md, chatbot, selected_comp_state, saved_state,
|
|
@@ -448,8 +450,9 @@ with gr.Blocks(title="Com.404 公司去那兒?", theme=gr.themes.Soft()) as de
|
|
| 448 |
outputs=[comp_df, saved_state]
|
| 449 |
)
|
| 450 |
|
|
|
|
| 451 |
btn_remove.click(
|
| 452 |
-
|
| 453 |
inputs=[selected_comp_state, saved_state, view_radio, search_res_state],
|
| 454 |
outputs=[gr.State(None), comp_df, saved_state, details_col]
|
| 455 |
)
|
|
|
|
| 369 |
# Chat Section
|
| 370 |
with gr.Column(elem_classes="chat-section"):
|
| 371 |
gr.Markdown("### 🤖 商業顧問 (已閱讀下方報告)")
|
| 372 |
+
# 這裡 Chatbot 使用預設設定 (相容 Tuple 格式)
|
| 373 |
chatbot = gr.Chatbot(height=250)
|
| 374 |
with gr.Row():
|
| 375 |
msg = gr.Textbox(label="提問", placeholder="例如:這間公司適合新鮮人嗎?有勞資糾紛嗎?", scale=4)
|
|
|
|
| 398 |
|
| 399 |
demo.load(init_on_load, inputs=None, outputs=[saved_state, comp_df])
|
| 400 |
|
| 401 |
+
# 🌟 這裡修正了:search_companies
|
| 402 |
search_btn.click(
|
| 403 |
+
search_companies,
|
| 404 |
inputs=[search_input, saved_state],
|
| 405 |
outputs=[comp_df, search_res_state, load_more_btn]
|
| 406 |
).then(
|
|
|
|
| 419 |
outputs=[comp_df, load_more_btn]
|
| 420 |
)
|
| 421 |
|
| 422 |
+
# 🌟 這裡修正了:select_company
|
| 423 |
comp_df.select(
|
| 424 |
+
select_company,
|
| 425 |
inputs=[search_res_state, saved_state, view_radio],
|
| 426 |
outputs=[
|
| 427 |
details_col, detail_md, chatbot, selected_comp_state, saved_state,
|
|
|
|
| 450 |
outputs=[comp_df, saved_state]
|
| 451 |
)
|
| 452 |
|
| 453 |
+
# 🌟 這裡修正了:remove_comp
|
| 454 |
btn_remove.click(
|
| 455 |
+
remove_comp,
|
| 456 |
inputs=[selected_comp_state, saved_state, view_radio, search_res_state],
|
| 457 |
outputs=[gr.State(None), comp_df, saved_state, details_col]
|
| 458 |
)
|