ankban commited on
Commit
192d806
Β·
verified Β·
1 Parent(s): 663b220

Update written_module.py

Browse files
Files changed (1) hide show
  1. written_module.py +7 -4
written_module.py CHANGED
@@ -60,19 +60,22 @@ def written_dashboard(nickname):
60
  with gr.Column() as written_panel:
61
  gr.Markdown("""
62
  <div id="header" style="text-align: center;">
 
63
  <h2>✍️ Written Communication with <strong>Chatter the Owl</strong></h2>
64
  <p>Paste or upload your writing. Select your goal and focus, and receive detailed feedback, improvement, and progress tracking.</p>
65
  </div>
66
  """)
67
 
68
- with gr.Row(elem_classes=["top-control-row"]):
69
  language_dropdown = gr.Dropdown(label="🌍 Language", choices=list(LANG_CODES.keys()), value="English")
70
  goal_dropdown = gr.Dropdown(label="🎯 Writing Goal", choices=["Essay for school", "Job application", "Blog post", "Creative writing", "General improvement"], value="General improvement")
71
  focus_checkboxes = gr.CheckboxGroup(label="🧠 Focus Areas", choices=["Clarity", "Organization", "Grammar", "Vocabulary", "Tone", "Creativity"], value=["Clarity", "Organization", "Grammar", "Vocabulary", "Tone", "Creativity"])
72
 
73
- with gr.Row(elem_classes=["audio-row"]):
74
  input_text = gr.Textbox(label="πŸ“ Your Writing", lines=8, elem_id="input_text", elem_classes=["text_area"])
75
- file_input = gr.File(label="πŸ“„ Upload Text File", file_types=[".txt", ".md"])
 
 
76
 
77
  feedback_box = gr.Textbox(label="πŸ’‘ Feedback", interactive=False, elem_id="feedback_box")
78
  improved_box = gr.Textbox(label="🎯 Improved Version", interactive=False, elem_id="improved_box")
@@ -115,7 +118,7 @@ def written_dashboard(nickname):
115
 
116
  return feedback, improved, session_table, score_plot, trend_plot, gr.update(visible=bool(milestone_msg), value=milestone_msg)
117
 
118
- input_text.change(
119
  fn=tutor_written,
120
  inputs=[input_text, language_dropdown, goal_dropdown, focus_checkboxes],
121
  outputs=[feedback_box, improved_box, history_table, score_chart, trend_chart, milestone_box]
 
60
  with gr.Column() as written_panel:
61
  gr.Markdown("""
62
  <div id="header" style="text-align: center;">
63
+ <img src="file/images/chatter_owl.png" width="120">
64
  <h2>✍️ Written Communication with <strong>Chatter the Owl</strong></h2>
65
  <p>Paste or upload your writing. Select your goal and focus, and receive detailed feedback, improvement, and progress tracking.</p>
66
  </div>
67
  """)
68
 
69
+ with gr.Row():
70
  language_dropdown = gr.Dropdown(label="🌍 Language", choices=list(LANG_CODES.keys()), value="English")
71
  goal_dropdown = gr.Dropdown(label="🎯 Writing Goal", choices=["Essay for school", "Job application", "Blog post", "Creative writing", "General improvement"], value="General improvement")
72
  focus_checkboxes = gr.CheckboxGroup(label="🧠 Focus Areas", choices=["Clarity", "Organization", "Grammar", "Vocabulary", "Tone", "Creativity"], value=["Clarity", "Organization", "Grammar", "Vocabulary", "Tone", "Creativity"])
73
 
74
+ with gr.Row():
75
  input_text = gr.Textbox(label="πŸ“ Your Writing", lines=8, elem_id="input_text", elem_classes=["text_area"])
76
+ submit_button = gr.Button("πŸš€ Submit", variant="primary")
77
+
78
+ file_input = gr.File(label="πŸ“„ Upload Text File", file_types=[".txt", ".md"])
79
 
80
  feedback_box = gr.Textbox(label="πŸ’‘ Feedback", interactive=False, elem_id="feedback_box")
81
  improved_box = gr.Textbox(label="🎯 Improved Version", interactive=False, elem_id="improved_box")
 
118
 
119
  return feedback, improved, session_table, score_plot, trend_plot, gr.update(visible=bool(milestone_msg), value=milestone_msg)
120
 
121
+ submit_button.click(
122
  fn=tutor_written,
123
  inputs=[input_text, language_dropdown, goal_dropdown, focus_checkboxes],
124
  outputs=[feedback_box, improved_box, history_table, score_chart, trend_chart, milestone_box]