youngtsai commited on
Commit
993b16c
·
1 Parent(s): 4334ce5

past_exam_correct_grammatical_spelling_errors_prompt = gr.Textbox(label="Correct Grammatical and Spelling Errors Prompt", value=default_user_correct_grammatical_spelling_errors_prompt, lines= 20)

Browse files
Files changed (1) hide show
  1. app.py +12 -6
app.py CHANGED
@@ -1491,18 +1491,21 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue=gr.themes.colors.blue, secondary
1491
  with gr.Row():
1492
  past_exam_evaluation_sys_content_prompt = gr.Textbox(label="System Prompt", value="You are an English teacher who is practicing with me to improve my English writing skill.", visible=False)
1493
  past_exam_evaluation_user_prompt = gr.Textbox(label="Paragraph evaluate Prompt", value=default_user_generate_paragraph_evaluate_prompt, visible=False)
1494
- past_exam_evaluation_input = gr.Textbox("",lines= 10)
1495
  with gr.Column():
1496
  with gr.Row():
1497
  past_exam_evaluation_button = gr.Button("評分", variant="primary")
1498
  with gr.Row():
1499
  past_exam_evaluation_output = gr.Dataframe(label="評分結果", wrap=True, column_widths=[20, 15, 65], interactive=False)
1500
 
1501
- # 修正錯誤語法
1502
  with gr.Row():
1503
  with gr.Column():
1504
- past_exam_correct_grammatical_spelling_errors_input = gr.Textbox(label="這是你的原始寫作內容,參考 JUTOR 的建議,你可以選擇是否修改:")
1505
  with gr.Column():
 
 
 
1506
  with gr.Row():
1507
  past_exam_generate_correct_grammatical_spelling_errors_button = gr.Button("JUTOR 修訂", variant="primary")
1508
  with gr.Row():
@@ -1517,8 +1520,11 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue=gr.themes.colors.blue, secondary
1517
  # 修正段落
1518
  with gr.Row():
1519
  with gr.Column():
1520
- past_exam_refine_input = gr.Textbox(label="這是你的原始寫作內容,參考 JUTOR 的建議,你可以選擇是否修改:", show_copy_button=True)
1521
  with gr.Column():
 
 
 
1522
  with gr.Row():
1523
  past_exam_generate_refine_button = gr.Button("段落改善建議", variant="primary")
1524
  with gr.Row():
@@ -1542,7 +1548,7 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue=gr.themes.colors.blue, secondary
1542
 
1543
  past_exam_generate_correct_grammatical_spelling_errors_button.click(
1544
  fn=generate_correct_grammatical_spelling_errors,
1545
- inputs=[past_exam_evaluation_sys_content_prompt, eng_level_input, past_exam_correct_grammatical_spelling_errors_input, user_correct_grammatical_spelling_errors_prompt],
1546
  outputs=[past_exam_correct_grammatical_spelling_errors_output_table, past_exam_revised_output]
1547
  ).then(
1548
  fn=highlight_diff_texts,
@@ -1556,7 +1562,7 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue=gr.themes.colors.blue, secondary
1556
 
1557
  past_exam_generate_refine_button.click(
1558
  fn=generate_refine_paragraph,
1559
- inputs=[past_exam_evaluation_sys_content_prompt, eng_level_input, past_exam_refine_input, user_refine_paragraph_prompt],
1560
  outputs=[past_exam_refine_output_table, past_exam_refine_output]
1561
  ).then(
1562
  fn=highlight_diff_texts,
 
1491
  with gr.Row():
1492
  past_exam_evaluation_sys_content_prompt = gr.Textbox(label="System Prompt", value="You are an English teacher who is practicing with me to improve my English writing skill.", visible=False)
1493
  past_exam_evaluation_user_prompt = gr.Textbox(label="Paragraph evaluate Prompt", value=default_user_generate_paragraph_evaluate_prompt, visible=False)
1494
+ past_exam_evaluation_input = gr.Textbox("",lines= 10, label="這是你的原始寫作內容,參考 JUTOR 的建議,你可以選擇是否修改:")
1495
  with gr.Column():
1496
  with gr.Row():
1497
  past_exam_evaluation_button = gr.Button("評分", variant="primary")
1498
  with gr.Row():
1499
  past_exam_evaluation_output = gr.Dataframe(label="評分結果", wrap=True, column_widths=[20, 15, 65], interactive=False)
1500
 
1501
+ # 修正錯字、語法
1502
  with gr.Row():
1503
  with gr.Column():
1504
+ past_exam_correct_grammatical_spelling_errors_input = gr.Textbox(label="這是你的原始寫作內容,參考 JUTOR 的建議,你可以選擇是否修改:",lines= 10, show_copy_button=True)
1505
  with gr.Column():
1506
+ with gr.Row():
1507
+ with gr.Accordion("prompt 提供微調測試", open=False):
1508
+ past_exam_correct_grammatical_spelling_errors_prompt = gr.Textbox(label="Correct Grammatical and Spelling Errors Prompt", value=default_user_correct_grammatical_spelling_errors_prompt, lines= 20)
1509
  with gr.Row():
1510
  past_exam_generate_correct_grammatical_spelling_errors_button = gr.Button("JUTOR 修訂", variant="primary")
1511
  with gr.Row():
 
1520
  # 修正段落
1521
  with gr.Row():
1522
  with gr.Column():
1523
+ past_exam_refine_input = gr.Textbox(label="這是你的原始寫作內容,參考 JUTOR 的建議,你可以選擇是否修改:", show_copy_button=True,lines= 10)
1524
  with gr.Column():
1525
+ with gr.Row():
1526
+ with gr.Accordion("prompt 提供微調測試", open=False):
1527
+ past_exam_refine_paragraph_prompt = gr.Textbox(label="Refine Paragraph Prompt", value=default_user_refine_paragraph_prompt, lines= 20)
1528
  with gr.Row():
1529
  past_exam_generate_refine_button = gr.Button("段落改善建議", variant="primary")
1530
  with gr.Row():
 
1548
 
1549
  past_exam_generate_correct_grammatical_spelling_errors_button.click(
1550
  fn=generate_correct_grammatical_spelling_errors,
1551
+ inputs=[past_exam_evaluation_sys_content_prompt, eng_level_input, past_exam_correct_grammatical_spelling_errors_input, past_exam_correct_grammatical_spelling_errors_prompt],
1552
  outputs=[past_exam_correct_grammatical_spelling_errors_output_table, past_exam_revised_output]
1553
  ).then(
1554
  fn=highlight_diff_texts,
 
1562
 
1563
  past_exam_generate_refine_button.click(
1564
  fn=generate_refine_paragraph,
1565
+ inputs=[past_exam_evaluation_sys_content_prompt, eng_level_input, past_exam_refine_input, past_exam_refine_paragraph_prompt],
1566
  outputs=[past_exam_refine_output_table, past_exam_refine_output]
1567
  ).then(
1568
  fn=highlight_diff_texts,