Skip to content

Commit a2e92c7

Browse files
authored
Allow for last_input_token_count=None (#644)
1 parent cb2218a commit a2e92c7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/smolagents/gradio_ui.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def stream_to_gradio(
141141

142142
for step_log in agent.run(task, stream=True, reset=reset_agent_memory, additional_args=additional_args):
143143
# Track tokens if model provides them
144-
if getattr(agent.model, "last_input_token_count", None):
144+
if getattr(agent.model, "last_input_token_count", None) is not None:
145145
total_input_tokens += agent.model.last_input_token_count
146146
total_output_tokens += agent.model.last_output_token_count
147147
if isinstance(step_log, ActionStep):

0 commit comments

Comments
 (0)