Spaces:
Sleeping
Sleeping
paragraph_save_output = gr.Textbox(label="Save and Share")
Browse files
app.py
CHANGED
@@ -259,6 +259,13 @@ def generate_refine_paragraph(eng_level, paragraph, user_refine_paragraph_prompt
|
|
259 |
|
260 |
return content
|
261 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
262 |
with gr.Blocks() as demo:
|
263 |
with gr.Row():
|
264 |
with gr.Column():
|
@@ -449,7 +456,16 @@ with gr.Blocks() as demo:
|
|
449 |
"""
|
450 |
user_refine_paragraph_prompt = gr.Textbox(label="Refine Paragraph Prompt", value=default_user_refine_paragraph_prompt)
|
451 |
generate_refine_paragraph_button = gr.Button("Refine Paragraph")
|
452 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
453 |
|
454 |
generate_topics_button.click(
|
455 |
fn=generate_topics,
|
@@ -561,7 +577,18 @@ with gr.Blocks() as demo:
|
|
561 |
paragraph_correct_grammatical_spelling_errors_input,
|
562 |
user_refine_paragraph_prompt
|
563 |
],
|
564 |
-
outputs=
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
565 |
)
|
566 |
|
567 |
demo.launch()
|
|
|
259 |
|
260 |
return content
|
261 |
|
262 |
+
def paragraph_save(refine_paragraph):
|
263 |
+
"""
|
264 |
+
保存用户输入的段落。
|
265 |
+
"""
|
266 |
+
return refine_paragraph
|
267 |
+
|
268 |
+
|
269 |
with gr.Blocks() as demo:
|
270 |
with gr.Row():
|
271 |
with gr.Column():
|
|
|
456 |
"""
|
457 |
user_refine_paragraph_prompt = gr.Textbox(label="Refine Paragraph Prompt", value=default_user_refine_paragraph_prompt)
|
458 |
generate_refine_paragraph_button = gr.Button("Refine Paragraph")
|
459 |
+
refine_output = gr.Textbox(label="Refine Paragraph 段落改善建議")
|
460 |
+
paragraph_refine_input = gr.Textbox(label="Paragraph 段落改善")
|
461 |
+
|
462 |
+
gr.Markdown("## 11. Save and Share")
|
463 |
+
paragraph_save_button = gr.Button("Save and Share")
|
464 |
+
paragraph_save_output = gr.Textbox(label="Save and Share")
|
465 |
+
|
466 |
+
|
467 |
+
|
468 |
+
|
469 |
|
470 |
generate_topics_button.click(
|
471 |
fn=generate_topics,
|
|
|
577 |
paragraph_correct_grammatical_spelling_errors_input,
|
578 |
user_refine_paragraph_prompt
|
579 |
],
|
580 |
+
outputs=refine_output
|
581 |
+
)
|
582 |
+
|
583 |
+
paragraph_save_button.click(
|
584 |
+
fn=paragraph_save,
|
585 |
+
inputs=[
|
586 |
+
paragraph_output,
|
587 |
+
paragraph_evaluate_output,
|
588 |
+
correct_grammatical_spelling_errors_output,
|
589 |
+
refine_output
|
590 |
+
],
|
591 |
+
output=paragraph_save_output
|
592 |
)
|
593 |
|
594 |
demo.launch()
|