Mhammad2023 commited on
Commit
9fdd86d
·
verified ·
1 Parent(s): 4af1d78

Update Gradio_UI.py

Browse files
Files changed (1) hide show
  1. Gradio_UI.py +4 -1
Gradio_UI.py CHANGED
@@ -146,7 +146,10 @@ def stream_to_gradio(
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 isinstance(step_log, ActionStep):
151
  step_log.input_token_count = agent.model.last_input_token_count
152
  step_log.output_token_count = agent.model.last_output_token_count
 
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
+
153
  if isinstance(step_log, ActionStep):
154
  step_log.input_token_count = agent.model.last_input_token_count
155
  step_log.output_token_count = agent.model.last_output_token_count