Spaces:
Running
Running
bug fix
Browse files- Gradio_UI.py +1 -1
Gradio_UI.py
CHANGED
@@ -141,7 +141,7 @@ def stream_to_gradio(
|
|
141 |
|
142 |
for step_log in agent.run(task, stream=True, reset=reset_agent_memory, additional_args=additional_args):
|
143 |
# Track tokens if model provides them
|
144 |
-
if hasattr(agent.model, "last_input_token_count"):
|
145 |
total_input_tokens += agent.model.last_input_token_count
|
146 |
total_output_tokens += agent.model.last_output_token_count
|
147 |
if isinstance(step_log, ActionStep):
|
|
|
141 |
|
142 |
for step_log in agent.run(task, stream=True, reset=reset_agent_memory, additional_args=additional_args):
|
143 |
# Track tokens if model provides them
|
144 |
+
if hasattr(agent.model, "last_input_token_count") and agent.model.last_input_token_count is not None:
|
145 |
total_input_tokens += agent.model.last_input_token_count
|
146 |
total_output_tokens += agent.model.last_output_token_count
|
147 |
if isinstance(step_log, ActionStep):
|