Spaces:
Sleeping
Sleeping
luminoussg
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -64,8 +64,11 @@ with gr.Blocks() as app:
|
|
64 |
# Output for total token count
|
65 |
total_output = gr.Number(label="Total Token Count", interactive=False)
|
66 |
|
67 |
-
#
|
68 |
-
|
|
|
|
|
|
|
69 |
|
70 |
# Launch the app
|
71 |
app.launch()
|
|
|
64 |
# Output for total token count
|
65 |
total_output = gr.Number(label="Total Token Count", interactive=False)
|
66 |
|
67 |
+
# Add a submit button to trigger token counting
|
68 |
+
submit_button = gr.Button("Submit")
|
69 |
+
|
70 |
+
# Link the button click event to the token counting function
|
71 |
+
submit_button.click(token_counter, [json_input, encoding_dropdown], [conversation_output, total_output])
|
72 |
|
73 |
# Launch the app
|
74 |
app.launch()
|