Spaces:
Sleeping
Sleeping
「Jutor 段落改善建議」區塊,右方修改結果
Browse files移除紅色 highlight 顯示
最下方加上語音輸出
app.py
CHANGED
@@ -998,7 +998,7 @@ def generate_refine_paragraph(model, max_tokens, sys_content, eng_level, paragra
|
|
998 |
]
|
999 |
|
1000 |
refine_paragraph_gr_update = gr.update(value=table_data, headers=headers, visible=True)
|
1001 |
-
revised_paragraph_gr_update = gr.update(value=data["Revised Paragraph"], visible=
|
1002 |
return refine_paragraph_gr_update, revised_paragraph_gr_update
|
1003 |
|
1004 |
except (json.JSONDecodeError, KeyError, ValueError) as e:
|
@@ -3278,9 +3278,11 @@ with gr.Blocks(theme=THEME, css=CSS) as demo:
|
|
3278 |
with gr.Column():
|
3279 |
generate_full_paragraph_refine_button = gr.Button("✨ JUTOR 段落改善建議", variant="primary")
|
3280 |
full_paragraph_refine_output_table = gr.DataFrame(label="段落改善建議", wrap=True, interactive=False)
|
3281 |
-
full_paragraph_refine_output = gr.HTML(label="改建議", visible=False)
|
3282 |
gr.Markdown("## 修改建議")
|
3283 |
-
|
|
|
|
|
|
|
3284 |
|
3285 |
# 寫作完成
|
3286 |
with gr.Row():
|
@@ -3358,15 +3360,21 @@ with gr.Blocks(theme=THEME, css=CSS) as demo:
|
|
3358 |
inputs=[
|
3359 |
model,
|
3360 |
max_tokens,
|
3361 |
-
sys_content_input,
|
3362 |
eng_level_input,
|
3363 |
full_paragraph_refine_input,
|
3364 |
],
|
3365 |
-
outputs=[
|
|
|
|
|
|
|
3366 |
).then(
|
3367 |
-
fn=
|
3368 |
-
inputs=[
|
3369 |
-
outputs=
|
|
|
|
|
|
|
3370 |
)
|
3371 |
|
3372 |
full_paragraph_save_button.click(
|
|
|
998 |
]
|
999 |
|
1000 |
refine_paragraph_gr_update = gr.update(value=table_data, headers=headers, visible=True)
|
1001 |
+
revised_paragraph_gr_update = gr.update(value=data["Revised Paragraph"], visible=True)
|
1002 |
return refine_paragraph_gr_update, revised_paragraph_gr_update
|
1003 |
|
1004 |
except (json.JSONDecodeError, KeyError, ValueError) as e:
|
|
|
3278 |
with gr.Column():
|
3279 |
generate_full_paragraph_refine_button = gr.Button("✨ JUTOR 段落改善建議", variant="primary")
|
3280 |
full_paragraph_refine_output_table = gr.DataFrame(label="段落改善建議", wrap=True, interactive=False)
|
|
|
3281 |
gr.Markdown("## 修改建議")
|
3282 |
+
full_paragraph_refine_output = gr.HTML(label="修改建議", visible=True)
|
3283 |
+
full_paragraph_refine_output_audio = gr.Audio(label="音檔", type="filepath")
|
3284 |
+
|
3285 |
+
# full_paragraph_refine_output_diff = gr.HTML()
|
3286 |
|
3287 |
# 寫作完成
|
3288 |
with gr.Row():
|
|
|
3360 |
inputs=[
|
3361 |
model,
|
3362 |
max_tokens,
|
3363 |
+
sys_content_input,
|
3364 |
eng_level_input,
|
3365 |
full_paragraph_refine_input,
|
3366 |
],
|
3367 |
+
outputs=[
|
3368 |
+
full_paragraph_refine_output_table,
|
3369 |
+
full_paragraph_refine_output,
|
3370 |
+
]
|
3371 |
).then(
|
3372 |
+
fn=paragraph_save_and_tts,
|
3373 |
+
inputs=[full_paragraph_refine_output],
|
3374 |
+
outputs=[
|
3375 |
+
full_paragraph_refine_output,
|
3376 |
+
full_paragraph_refine_output_audio
|
3377 |
+
]
|
3378 |
)
|
3379 |
|
3380 |
full_paragraph_save_button.click(
|