Allow for last_input_token_count=None (#644)
This commit is contained in:
parent
cb2218a86f
commit
a2e92c74a9
|
@ -141,7 +141,7 @@ def stream_to_gradio(
|
|||
|
||||
for step_log in agent.run(task, stream=True, reset=reset_agent_memory, additional_args=additional_args):
|
||||
# Track tokens if model provides them
|
||||
if getattr(agent.model, "last_input_token_count", None):
|
||||
if getattr(agent.model, "last_input_token_count", None) is not None:
|
||||
total_input_tokens += agent.model.last_input_token_count
|
||||
total_output_tokens += agent.model.last_output_token_count
|
||||
if isinstance(step_log, ActionStep):
|
||||
|
|
Loading…
Reference in New Issue