Spaces:
Sleeping
Sleeping
worksheet_exam_result_fine_tune_btn.click(
Browse files
app.py
CHANGED
@@ -1669,16 +1669,26 @@ with gr.Blocks() as demo:
|
|
1669 |
content_grade = gr.Dropdown(label="選擇年級", choices=["一年級", "二年級", "三年級", "四年級", "五年級", "六年級", "七年級", "八年級", "九年級", "十年級", "十一年級", "十二年級"], value="三年級")
|
1670 |
content_level = gr.Dropdown(label="差異化教學", choices=["基礎", "中級", "進階"], value="基礎")
|
1671 |
with gr.Row():
|
1672 |
-
with gr.Column(scale=1):
|
1673 |
-
# with gr.Tab("認知階層評量題目"):
|
1674 |
-
# cognitive_level_content = gr.Textbox(label="輸入學習目標與內容")
|
1675 |
-
# cognitive_level_content_btn = gr.Button("生成評量題目")
|
1676 |
with gr.Tab("學習單"):
|
1677 |
-
|
1678 |
-
|
1679 |
-
|
1680 |
-
|
1681 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1682 |
with gr.Tab("課程計畫"):
|
1683 |
lesson_plan_content_type_name = gr.Textbox(value="lesson_plan", visible=False)
|
1684 |
lesson_plan_time = gr.Slider(label="選擇課程時間(分鐘)", minimum=10, maximum=120, step=5, value=40)
|
@@ -1705,16 +1715,7 @@ with gr.Blocks() as demo:
|
|
1705 |
# with gr.Tab("後設認知"):
|
1706 |
# metacognition_content = gr.Textbox(label="輸入後設認知相關問題")
|
1707 |
# metacognition_content_btn = gr.Button("生成後設認知問題")
|
1708 |
-
|
1709 |
-
# 生成對應不同模式的結果
|
1710 |
-
exam_result_prompt = gr.Textbox(visible=False)
|
1711 |
-
exam_result = gr.Textbox(label="初次生成結果", show_copy_button=True, interactive=True)
|
1712 |
-
exam_result_fine_tune_prompt = gr.Textbox(label="根據結果,輸入你想更改的想法")
|
1713 |
-
exam_result_fine_tune_btn = gr.Button("微調結果")
|
1714 |
-
exam_result_fine_result = gr.Textbox(label="微調結果",show_copy_button=True)
|
1715 |
-
|
1716 |
-
download_exam_result_button = gr.Button("下载结果")
|
1717 |
-
exam_result_word_link = gr.File(label="Download Word")
|
1718 |
|
1719 |
# OPENAI 模式
|
1720 |
send_button.click(
|
@@ -1831,15 +1832,15 @@ with gr.Blocks() as demo:
|
|
1831 |
)
|
1832 |
|
1833 |
# 生成結果微調
|
1834 |
-
|
1835 |
generate_exam_fine_tune_result,
|
1836 |
-
inputs=[password,
|
1837 |
-
outputs=[
|
1838 |
)
|
1839 |
-
|
1840 |
download_exam_result,
|
1841 |
-
inputs=[
|
1842 |
-
outputs=[
|
1843 |
)
|
1844 |
|
1845 |
|
|
|
1669 |
content_grade = gr.Dropdown(label="選擇年級", choices=["一年級", "二年級", "三年級", "四年級", "五年級", "六年級", "七年級", "八年級", "九年級", "十年級", "十一年級", "十二年級"], value="三年級")
|
1670 |
content_level = gr.Dropdown(label="差異化教學", choices=["基礎", "中級", "進階"], value="基礎")
|
1671 |
with gr.Row():
|
|
|
|
|
|
|
|
|
1672 |
with gr.Tab("學習單"):
|
1673 |
+
with gr.Row():
|
1674 |
+
with gr.Column(scale=1):
|
1675 |
+
worksheet_content_type_name = gr.Textbox(value="worksheet", visible=False)
|
1676 |
+
worksheet_algorithm = gr.Dropdown(label="選擇教學策略或理論", choices=["Bloom認知階層理論", "Polya數學解題法", "CRA教學法"], value="Bloom認知階層理論")
|
1677 |
+
worksheet_content_btn = gr.Button("生成學習單 📄")
|
1678 |
+
with gr.Accordion("prompt", open=False):
|
1679 |
+
worksheet_prompt = gr.Textbox(label="worksheet_prompt", show_copy_button=True, lines=40)
|
1680 |
+
with gr.Column(scale=2):
|
1681 |
+
# 生成對應不同模式的結果
|
1682 |
+
worksheet_exam_result_prompt = gr.Textbox(visible=False)
|
1683 |
+
worksheet_exam_result = gr.Textbox(label="初次生成結果", show_copy_button=True, interactive=True)
|
1684 |
+
worksheet_exam_result_fine_tune_prompt = gr.Textbox(label="根據結果,輸入你想更改的想法")
|
1685 |
+
worksheet_exam_result_fine_tune_btn = gr.Button("微調結果")
|
1686 |
+
worksheet_exam_result_fine_result = gr.Textbox(label="微調結果",show_copy_button=True)
|
1687 |
+
|
1688 |
+
worksheet_download_exam_result_button = gr.Button("下载结果")
|
1689 |
+
worksheet_exam_result_word_link = gr.File(label="Download Word")
|
1690 |
+
|
1691 |
+
|
1692 |
with gr.Tab("課程計畫"):
|
1693 |
lesson_plan_content_type_name = gr.Textbox(value="lesson_plan", visible=False)
|
1694 |
lesson_plan_time = gr.Slider(label="選擇課程時間(分鐘)", minimum=10, maximum=120, step=5, value=40)
|
|
|
1715 |
# with gr.Tab("後設認知"):
|
1716 |
# metacognition_content = gr.Textbox(label="輸入後設認知相關問題")
|
1717 |
# metacognition_content_btn = gr.Button("生成後設認知問題")
|
1718 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1719 |
|
1720 |
# OPENAI 模式
|
1721 |
send_button.click(
|
|
|
1832 |
)
|
1833 |
|
1834 |
# 生成結果微調
|
1835 |
+
worksheet_exam_result_fine_tune_btn.click(
|
1836 |
generate_exam_fine_tune_result,
|
1837 |
+
inputs=[password, worksheet_exam_result_prompt, df_string_output, worksheet_exam_result, worksheet_exam_result_fine_tune_prompt],
|
1838 |
+
outputs=[worksheet_exam_result_fine_result]
|
1839 |
)
|
1840 |
+
worksheet_download_exam_result_button.click(
|
1841 |
download_exam_result,
|
1842 |
+
inputs=[worksheet_exam_result],
|
1843 |
+
outputs=[worksheet_exam_result_word_link]
|
1844 |
)
|
1845 |
|
1846 |
|