luminoussg commited on
Commit
47925da
·
verified ·
1 Parent(s): f825e7c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
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
- # Link the inputs and outputs to the function
68
- json_input.change(token_counter, [json_input, encoding_dropdown], [conversation_output, total_output])
 
 
 
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()