Spaces:
Sleeping
Sleeping
file_names.sort(reverse=True)
Browse files
app.py
CHANGED
@@ -622,7 +622,8 @@ def get_logs_sessions(user_data, log_type):
|
|
622 |
file_names = []
|
623 |
|
624 |
|
625 |
-
#
|
|
|
626 |
choices = [
|
627 |
(file_name.split("/")[-1].split(".")[0], file_name) for file_name in file_names
|
628 |
]
|
@@ -2036,56 +2037,57 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue=gr.themes.colors.blue, secondary
|
|
2036 |
with gr.Row():
|
2037 |
gr.Markdown("# 📚 歷程回顧")
|
2038 |
with gr.Row():
|
2039 |
-
with gr.
|
2040 |
-
|
2041 |
-
|
2042 |
-
|
2043 |
-
|
2044 |
-
|
2045 |
-
|
2046 |
-
gr.
|
2047 |
-
|
2048 |
-
|
2049 |
-
|
2050 |
-
|
2051 |
-
|
2052 |
-
|
2053 |
-
|
2054 |
-
|
2055 |
-
|
2056 |
-
|
2057 |
-
|
2058 |
-
|
2059 |
-
|
2060 |
-
|
2061 |
-
|
2062 |
-
|
2063 |
-
|
2064 |
-
|
2065 |
-
|
2066 |
-
|
2067 |
-
|
2068 |
-
|
2069 |
-
|
2070 |
-
|
2071 |
-
|
2072 |
-
|
2073 |
-
|
2074 |
-
|
2075 |
-
|
2076 |
-
|
2077 |
-
|
2078 |
-
|
2079 |
-
|
2080 |
-
|
2081 |
-
|
2082 |
-
|
2083 |
-
|
2084 |
-
|
2085 |
-
|
2086 |
-
|
2087 |
-
|
2088 |
-
|
|
|
2089 |
|
2090 |
|
2091 |
english_grapragh_practice_button.click(
|
|
|
622 |
file_names = []
|
623 |
|
624 |
|
625 |
+
# file_names sort by timestamp DESC
|
626 |
+
file_names.sort(reverse=True)
|
627 |
choices = [
|
628 |
(file_name.split("/")[-1].split(".")[0], file_name) for file_name in file_names
|
629 |
]
|
|
|
2037 |
with gr.Row():
|
2038 |
gr.Markdown("# 📚 歷程回顧")
|
2039 |
with gr.Row():
|
2040 |
+
with gr.Accordion("英文段落練習歷程回顧", open=False) as paragraph_logs_accordion:
|
2041 |
+
with gr.Row():
|
2042 |
+
with gr.Column(scale=1):
|
2043 |
+
# 取得英文段落練習 log from GCS
|
2044 |
+
paragraph_logs_type = gr.State("jutor_write_paragraph")
|
2045 |
+
get_paragraph_logs_button = gr.Button("取得英文段落練習歷程")
|
2046 |
+
paragraph_logs_session_list = gr.Radio(label="歷程時間列表")
|
2047 |
+
with gr.Column(scale=3):
|
2048 |
+
gr.Markdown("<span style='color:#4e80ee'>主題</span>")
|
2049 |
+
paragraph_log_topic_input_history = gr.Markdown(label="主題")
|
2050 |
+
gr.Markdown("<span style='color:#4e80ee'>要點/關鍵字</span>")
|
2051 |
+
paragraph_log_points_input_history = gr.Markdown(label="要點/關鍵字")
|
2052 |
+
gr.Markdown("<span style='color:#4e80ee'>主題句</span>")
|
2053 |
+
paragraph_log_topic_sentence_input_history = gr.Markdown(label="主題句")
|
2054 |
+
gr.Markdown("<span style='color:#4e80ee'>支持句</span>")
|
2055 |
+
paragraph_log_supporting_sentences_input_history = gr.Markdown(label="支持句")
|
2056 |
+
gr.Markdown("<span style='color:#4e80ee'>結論句</span>")
|
2057 |
+
paragraph_log_conclusion_sentence_input_history = gr.Markdown(label="結論句")
|
2058 |
+
gr.Markdown("<span style='color:#4e80ee'>完整段落</span>")
|
2059 |
+
paragraph_log_paragraph_output_history = gr.Markdown(label="完整段落")
|
2060 |
+
paragraph_log_paragraph_evaluate_output_history = gr.Dataframe(label="完整段落分析", wrap=True, column_widths=[35, 15, 50], interactive=False)
|
2061 |
+
paragraph_log_correct_grammatical_spelling_errors_output_table_history = gr.Dataframe(label="修訂文法與拼字錯誤", interactive=False, wrap=True, column_widths=[30, 30, 40])
|
2062 |
+
paragraph_log_refine_output_table_history = gr.Dataframe(label="段落改善建議", wrap=True, interactive=False, column_widths=[30, 30, 40])
|
2063 |
+
gr.Markdown("<span style='color:#4e80ee'>修改建議</span>")
|
2064 |
+
paragraph_log_refine_output_history = gr.Markdown(label="修改建議")
|
2065 |
+
gr.Markdown("<span style='color:#4e80ee'>修改結果</span>")
|
2066 |
+
paragraph_log_paragraph_save_output = gr.Markdown(label="最後結果")
|
2067 |
+
|
2068 |
+
get_paragraph_logs_button.click(
|
2069 |
+
fn=get_logs_sessions,
|
2070 |
+
inputs=[user_data, paragraph_logs_type],
|
2071 |
+
outputs=[paragraph_logs_session_list]
|
2072 |
+
)
|
2073 |
+
|
2074 |
+
paragraph_logs_session_list.select(
|
2075 |
+
fn=get_log_session_content,
|
2076 |
+
inputs=[paragraph_logs_session_list],
|
2077 |
+
outputs=[
|
2078 |
+
paragraph_log_topic_input_history,
|
2079 |
+
paragraph_log_points_input_history,
|
2080 |
+
paragraph_log_topic_sentence_input_history,
|
2081 |
+
paragraph_log_supporting_sentences_input_history,
|
2082 |
+
paragraph_log_conclusion_sentence_input_history,
|
2083 |
+
paragraph_log_paragraph_output_history,
|
2084 |
+
paragraph_log_paragraph_evaluate_output_history,
|
2085 |
+
paragraph_log_correct_grammatical_spelling_errors_output_table_history,
|
2086 |
+
paragraph_log_refine_output_table_history,
|
2087 |
+
paragraph_log_refine_output_history,
|
2088 |
+
paragraph_log_paragraph_save_output
|
2089 |
+
]
|
2090 |
+
)
|
2091 |
|
2092 |
|
2093 |
english_grapragh_practice_button.click(
|