Mhammad2023 commited on
Commit
6fd9338
·
verified ·
1 Parent(s): cd606ea

Update Gradio_UI.py

Browse files
Files changed (1) hide show
  1. Gradio_UI.py +9 -2
Gradio_UI.py CHANGED
@@ -144,9 +144,16 @@ def stream_to_gradio(
144
  if hasattr(agent.model, "last_input_token_count"):
145
  # token_count = agent.model.last_input_token_count or 0
146
  # total_input_tokens += token_count
147
- total_input_tokens += agent.model.last_input_token_count
148
 
149
- total_output_tokens += agent.model.last_output_token_count
 
 
 
 
 
 
 
 
150
  # if agent.model.last_output_token_count is not None:
151
  # total_output_tokens += agent.model.last_output_token_count
152
 
 
144
  if hasattr(agent.model, "last_input_token_count"):
145
  # token_count = agent.model.last_input_token_count or 0
146
  # total_input_tokens += token_count
 
147
 
148
+ # total_input_tokens += agent.model.last_input_token_count
149
+ # total_output_tokens += agent.model.last_output_token_count
150
+
151
+ input_tokens = agent.model.last_input_token_count or 0
152
+ output_tokens = agent.model.last_output_token_count or 0
153
+ total_input_tokens += input_tokens
154
+ total_output_tokens += output_tokens
155
+
156
+
157
  # if agent.model.last_output_token_count is not None:
158
  # total_output_tokens += agent.model.last_output_token_count
159