Spaces:
Sleeping
Sleeping
Add block_ready_flag (#2)
Browse files- Add block_ready_flag (4b62fa4d67eb94355fc4825bd83b8fe8c6b89f23)
app.py
CHANGED
@@ -2944,6 +2944,7 @@ def init_params(text, request: gr.Request):
|
|
2944 |
|
2945 |
youtube_link = ""
|
2946 |
password_text = ""
|
|
|
2947 |
admin = gr.update(visible=True)
|
2948 |
reading_passage_admin = gr.update(visible=True)
|
2949 |
summary_admin = gr.update(visible=True)
|
@@ -2982,7 +2983,7 @@ def init_params(text, request: gr.Request):
|
|
2982 |
|
2983 |
return admin, reading_passage_admin, summary_admin, see_detail, \
|
2984 |
worksheet_accordion, lesson_plan_accordion, exit_ticket_accordion, \
|
2985 |
-
password_text, youtube_link, \
|
2986 |
chatbot_open_ai_streaming, chatbot_ai, ai_chatbot_params, \
|
2987 |
is_env_prod
|
2988 |
|
@@ -3045,6 +3046,8 @@ with gr.Blocks(theme=gr.themes.Base(primary_hue=gr.themes.colors.orange, seconda
|
|
3045 |
# file_upload = gr.File(label="Upload your CSV or Word file", visible=False)
|
3046 |
# web_link = gr.Textbox(label="Enter Web Page Link", visible=False)
|
3047 |
user_data = gr.Textbox(label="User Data", elem_id="user_data_input", visible=True)
|
|
|
|
|
3048 |
youtube_link_btn = gr.Button("Submit_YouTube_Link", elem_id="youtube_link_btn", visible=True)
|
3049 |
with gr.Row() as data_state:
|
3050 |
content_subject_state = gr.State() # 使用 gr.State 存储 content_subject
|
@@ -3913,6 +3916,7 @@ with gr.Blocks(theme=gr.themes.Base(primary_hue=gr.themes.colors.orange, seconda
|
|
3913 |
exit_ticket_accordion,
|
3914 |
password,
|
3915 |
youtube_link,
|
|
|
3916 |
chatbot_open_ai_streaming,
|
3917 |
chatbot_ai,
|
3918 |
ai_chatbot_params,
|
|
|
2944 |
|
2945 |
youtube_link = ""
|
2946 |
password_text = ""
|
2947 |
+
block_ready_flag = "READY"
|
2948 |
admin = gr.update(visible=True)
|
2949 |
reading_passage_admin = gr.update(visible=True)
|
2950 |
summary_admin = gr.update(visible=True)
|
|
|
2983 |
|
2984 |
return admin, reading_passage_admin, summary_admin, see_detail, \
|
2985 |
worksheet_accordion, lesson_plan_accordion, exit_ticket_accordion, \
|
2986 |
+
password_text, youtube_link, block_ready_flag, \
|
2987 |
chatbot_open_ai_streaming, chatbot_ai, ai_chatbot_params, \
|
2988 |
is_env_prod
|
2989 |
|
|
|
3046 |
# file_upload = gr.File(label="Upload your CSV or Word file", visible=False)
|
3047 |
# web_link = gr.Textbox(label="Enter Web Page Link", visible=False)
|
3048 |
user_data = gr.Textbox(label="User Data", elem_id="user_data_input", visible=True)
|
3049 |
+
# block_ready_flag: 讓主站的 Vaitor component 知道 Blocks.load 已經執行完成(當 block_ready_flag = "READY" 時)
|
3050 |
+
block_ready_flag = gr.Textbox(label="Block Ready Flag", elem_id="block_ready_flag", visible=False, value="LOADING")
|
3051 |
youtube_link_btn = gr.Button("Submit_YouTube_Link", elem_id="youtube_link_btn", visible=True)
|
3052 |
with gr.Row() as data_state:
|
3053 |
content_subject_state = gr.State() # 使用 gr.State 存储 content_subject
|
|
|
3916 |
exit_ticket_accordion,
|
3917 |
password,
|
3918 |
youtube_link,
|
3919 |
+
block_ready_flag,
|
3920 |
chatbot_open_ai_streaming,
|
3921 |
chatbot_ai,
|
3922 |
ai_chatbot_params,
|