diana3135 commited on
Commit
b430afa
·
1 Parent(s): aee476b

add word counter

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -191,8 +191,8 @@ if __name__ == "__main__":
191
  with group_a_content:
192
  with gr.Row():
193
  human_input = gr.Textbox(label="Human Input (At least 50 words)")
194
- # word_count_display_a = gr.Label(value="Word count: 0")
195
- # human_input.change(fn=update_word_count, inputs=human_input, outputs=word_count_display_a)
196
  with gr.Row():
197
  submit_btn = gr.Button("Create")
198
  with gr.Row():
@@ -244,8 +244,8 @@ if __name__ == "__main__":
244
  with gr.Row():
245
  initial_answer = gr.Textbox(label="AI Initial Answer")
246
  modification_suggestions = gr.Textbox(label="Modification Suggestions (At least 50 words)")
247
- # word_count_display_b = gr.Label(value="Word count: 0")
248
- # modification_suggestions.change(fn=update_word_count, inputs=modification_suggestions, outputs=word_count_display_b)
249
  with gr.Row():
250
  create_final_btn = gr.Button("Modify")
251
  with gr.Row():
@@ -305,8 +305,8 @@ if __name__ == "__main__":
305
  with group_c_content:
306
  with gr.Row():
307
  human_input = gr.Textbox(label="Human Input (At least 50 words)", elem_id="human_input")
308
- # word_count_display_c = gr.Label(value="Word count: 0")
309
- # human_input.change(fn=update_word_count, inputs=human_input, outputs=word_count_display_c)
310
  with gr.Row():
311
  create_btn = gr.Button("Create")
312
  with gr.Row():
 
191
  with group_a_content:
192
  with gr.Row():
193
  human_input = gr.Textbox(label="Human Input (At least 50 words)")
194
+ word_count_display_a = gr.Label(value="Word count: 0")
195
+ human_input.change(fn=update_word_count, inputs=human_input, outputs=word_count_display_a)
196
  with gr.Row():
197
  submit_btn = gr.Button("Create")
198
  with gr.Row():
 
244
  with gr.Row():
245
  initial_answer = gr.Textbox(label="AI Initial Answer")
246
  modification_suggestions = gr.Textbox(label="Modification Suggestions (At least 50 words)")
247
+ word_count_display_b = gr.Label(value="Word count: 0")
248
+ modification_suggestions.change(fn=update_word_count, inputs=modification_suggestions, outputs=word_count_display_b)
249
  with gr.Row():
250
  create_final_btn = gr.Button("Modify")
251
  with gr.Row():
 
305
  with group_c_content:
306
  with gr.Row():
307
  human_input = gr.Textbox(label="Human Input (At least 50 words)", elem_id="human_input")
308
+ word_count_display_c = gr.Label(value="Word count: 0")
309
+ human_input.change(fn=update_word_count, inputs=human_input, outputs=word_count_display_c)
310
  with gr.Row():
311
  create_btn = gr.Button("Create")
312
  with gr.Row():