Spaces:
Sleeping
Sleeping
worksheet_accordion,
Browse fileslesson_plan_accordion,
exit_ticket_accordion,
app.py
CHANGED
|
@@ -2014,6 +2014,9 @@ def init_params(text, request: gr.Request):
|
|
| 2014 |
reading_passage_admin = gr.update(visible=True)
|
| 2015 |
summary_admin = gr.update(visible=True)
|
| 2016 |
see_detail = gr.update(visible=True)
|
|
|
|
|
|
|
|
|
|
| 2017 |
|
| 2018 |
# if youtube_link in query_params
|
| 2019 |
if "youtube_id" in request.query_params:
|
|
@@ -2029,8 +2032,13 @@ def init_params(text, request: gr.Request):
|
|
| 2029 |
reading_passage_admin = gr.update(visible=False)
|
| 2030 |
summary_admin = gr.update(visible=False)
|
| 2031 |
see_detail = gr.update(visible=False)
|
|
|
|
|
|
|
|
|
|
| 2032 |
|
| 2033 |
-
return admin, reading_passage_admin, summary_admin, see_detail,
|
|
|
|
|
|
|
| 2034 |
|
| 2035 |
def update_state(content_subject, content_grade, trascript, key_moments, question_1, question_2, question_3):
|
| 2036 |
# inputs=[content_subject, content_grade, df_string_output],
|
|
@@ -2214,7 +2222,7 @@ with gr.Blocks(theme=gr.themes.Base(primary_hue=gr.themes.colors.orange, seconda
|
|
| 2214 |
worksheet_exam_result_fine_tune_prompt = gr.Textbox(label="根據結果,輸入你想更改的想法")
|
| 2215 |
worksheet_exam_result_fine_tune_btn = gr.Button("微調結果", variant="primary")
|
| 2216 |
worksheet_exam_result_retrun_original = gr.Button("返回原始結果")
|
| 2217 |
-
with gr.Accordion("prompt", open=False):
|
| 2218 |
worksheet_prompt = gr.Textbox(label="worksheet_prompt", show_copy_button=True, lines=40)
|
| 2219 |
with gr.Column(scale=2):
|
| 2220 |
# 生成對應不同模式的結果
|
|
@@ -2235,7 +2243,7 @@ with gr.Blocks(theme=gr.themes.Base(primary_hue=gr.themes.colors.orange, seconda
|
|
| 2235 |
lesson_plan_exam_result_fine_tune_prompt = gr.Textbox(label="根據結果,輸入你想更改的想法")
|
| 2236 |
lesson_plan_exam_result_fine_tune_btn = gr.Button("微調結果", variant="primary")
|
| 2237 |
lesson_plan_exam_result_retrun_original = gr.Button("返回原始結果")
|
| 2238 |
-
with gr.Accordion("prompt", open=False):
|
| 2239 |
lesson_plan_prompt = gr.Textbox(label="worksheet_prompt", show_copy_button=True, lines=40)
|
| 2240 |
with gr.Column(scale=2):
|
| 2241 |
# 生成對應不同模式的結果
|
|
@@ -2257,7 +2265,7 @@ with gr.Blocks(theme=gr.themes.Base(primary_hue=gr.themes.colors.orange, seconda
|
|
| 2257 |
exit_ticket_exam_result_fine_tune_prompt = gr.Textbox(label="根據結果,輸入你想更改的想法")
|
| 2258 |
exit_ticket_exam_result_fine_tune_btn = gr.Button("微調結果", variant="primary")
|
| 2259 |
exit_ticket_exam_result_retrun_original = gr.Button("返回原始結果")
|
| 2260 |
-
with gr.Accordion("prompt", open=False):
|
| 2261 |
exit_ticket_prompt = gr.Textbox(label="worksheet_prompt", show_copy_button=True, lines=40)
|
| 2262 |
with gr.Column(scale=2):
|
| 2263 |
# 生成對應不同模式的結果
|
|
@@ -2636,10 +2644,21 @@ with gr.Blocks(theme=gr.themes.Base(primary_hue=gr.themes.colors.orange, seconda
|
|
| 2636 |
)
|
| 2637 |
|
| 2638 |
# init_params
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2639 |
demo.load(
|
| 2640 |
init_params,
|
| 2641 |
inputs =[youtube_link],
|
| 2642 |
-
outputs =
|
| 2643 |
)
|
| 2644 |
|
| 2645 |
demo.launch(allowed_paths=["videos"])
|
|
|
|
| 2014 |
reading_passage_admin = gr.update(visible=True)
|
| 2015 |
summary_admin = gr.update(visible=True)
|
| 2016 |
see_detail = gr.update(visible=True)
|
| 2017 |
+
worksheet_accordion = gr.update(visible=True)
|
| 2018 |
+
lesson_plan_accordion = gr.update(visible=True)
|
| 2019 |
+
exit_ticket_accordion = gr.update(visible=True)
|
| 2020 |
|
| 2021 |
# if youtube_link in query_params
|
| 2022 |
if "youtube_id" in request.query_params:
|
|
|
|
| 2032 |
reading_passage_admin = gr.update(visible=False)
|
| 2033 |
summary_admin = gr.update(visible=False)
|
| 2034 |
see_detail = gr.update(visible=False)
|
| 2035 |
+
worksheet_accordion = gr.update(visible=False)
|
| 2036 |
+
lesson_plan_accordion = gr.update(visible=False)
|
| 2037 |
+
exit_ticket_accordion = gr.update(visible=False)
|
| 2038 |
|
| 2039 |
+
return admin, reading_passage_admin, summary_admin, see_detail, \
|
| 2040 |
+
worksheet_accordion, lesson_plan_accordion, exit_ticket_accordion, \
|
| 2041 |
+
password_text, youtube_link
|
| 2042 |
|
| 2043 |
def update_state(content_subject, content_grade, trascript, key_moments, question_1, question_2, question_3):
|
| 2044 |
# inputs=[content_subject, content_grade, df_string_output],
|
|
|
|
| 2222 |
worksheet_exam_result_fine_tune_prompt = gr.Textbox(label="根據結果,輸入你想更改的想法")
|
| 2223 |
worksheet_exam_result_fine_tune_btn = gr.Button("微調結果", variant="primary")
|
| 2224 |
worksheet_exam_result_retrun_original = gr.Button("返回原始結果")
|
| 2225 |
+
with gr.Accordion("prompt", open=False) as worksheet_accordion:
|
| 2226 |
worksheet_prompt = gr.Textbox(label="worksheet_prompt", show_copy_button=True, lines=40)
|
| 2227 |
with gr.Column(scale=2):
|
| 2228 |
# 生成對應不同模式的結果
|
|
|
|
| 2243 |
lesson_plan_exam_result_fine_tune_prompt = gr.Textbox(label="根據結果,輸入你想更改的想法")
|
| 2244 |
lesson_plan_exam_result_fine_tune_btn = gr.Button("微調結果", variant="primary")
|
| 2245 |
lesson_plan_exam_result_retrun_original = gr.Button("返回原始結果")
|
| 2246 |
+
with gr.Accordion("prompt", open=False) as lesson_plan_accordion:
|
| 2247 |
lesson_plan_prompt = gr.Textbox(label="worksheet_prompt", show_copy_button=True, lines=40)
|
| 2248 |
with gr.Column(scale=2):
|
| 2249 |
# 生成對應不同模式的結果
|
|
|
|
| 2265 |
exit_ticket_exam_result_fine_tune_prompt = gr.Textbox(label="根據結果,輸入你想更改的想法")
|
| 2266 |
exit_ticket_exam_result_fine_tune_btn = gr.Button("微調結果", variant="primary")
|
| 2267 |
exit_ticket_exam_result_retrun_original = gr.Button("返回原始結果")
|
| 2268 |
+
with gr.Accordion("prompt", open=False) as exit_ticket_accordion:
|
| 2269 |
exit_ticket_prompt = gr.Textbox(label="worksheet_prompt", show_copy_button=True, lines=40)
|
| 2270 |
with gr.Column(scale=2):
|
| 2271 |
# 生成對應不同模式的結果
|
|
|
|
| 2644 |
)
|
| 2645 |
|
| 2646 |
# init_params
|
| 2647 |
+
init_outputs = [
|
| 2648 |
+
admin,
|
| 2649 |
+
reading_passage_admin,
|
| 2650 |
+
summary_admmin,
|
| 2651 |
+
see_details,
|
| 2652 |
+
worksheet_accordion,
|
| 2653 |
+
lesson_plan_accordion,
|
| 2654 |
+
exit_ticket_accordion,
|
| 2655 |
+
password,
|
| 2656 |
+
youtube_link
|
| 2657 |
+
]
|
| 2658 |
demo.load(
|
| 2659 |
init_params,
|
| 2660 |
inputs =[youtube_link],
|
| 2661 |
+
outputs = init_outputs
|
| 2662 |
)
|
| 2663 |
|
| 2664 |
demo.launch(allowed_paths=["videos"])
|