Spaces:
Sleeping
Sleeping
diana3135
commited on
Commit
·
baba5be
1
Parent(s):
de26bd7
adjust word counter size
Browse files
app.py
CHANGED
|
@@ -142,7 +142,7 @@ def on_textbox_change(session_index, session_manager, service, SHEET_ID):
|
|
| 142 |
|
| 143 |
def update_word_count(text):
|
| 144 |
words = text.split()
|
| 145 |
-
return f"Word count: {len(words)}"
|
| 146 |
|
| 147 |
if __name__ == "__main__":
|
| 148 |
api_key = get_api_key(local=False)
|
|
@@ -305,12 +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 |
-
|
| 309 |
-
|
| 310 |
-
fn=update_word_count,
|
| 311 |
-
inputs=human_input,
|
| 312 |
-
outputs=word_count
|
| 313 |
-
)
|
| 314 |
with gr.Row():
|
| 315 |
create_btn = gr.Button("Create")
|
| 316 |
with gr.Row():
|
|
|
|
| 142 |
|
| 143 |
def update_word_count(text):
|
| 144 |
words = text.split()
|
| 145 |
+
return f"<span style='font-size: 14px; color: #333;'>Word count: {len(words)}</span>"
|
| 146 |
|
| 147 |
if __name__ == "__main__":
|
| 148 |
api_key = get_api_key(local=False)
|
|
|
|
| 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():
|